diff mbox

[AArch64] aarch64-c.o should depend on TARGET_H

Message ID 1478008724-34066-1-git-send-email-james.greenhalgh@arm.com
State New
Headers show

Commit Message

James Greenhalgh Nov. 1, 2016, 1:58 p.m. UTC
Hi,

I've noticed that aarch64-c.o doesn't get rebuilt after a change to
the target hooks. That leaves it out of sync with the rest of the compiler
in incremental builds, which in turn causes this code to write to the wrong
memory location:

  void
  aarch64_register_pragmas (void)
  {
    /* Update pragma hook to allow parsing #pragma GCC target.  */
    targetm.target_option.pragma_parse = aarch64_pragma_target_parse;
  }

Leaving pragma_parse pointing at the default implementation, and mangling
poor innocent targetm.target_option.print (which generally we don't use
after the rebuild - else we likely would see it here too).

This change adds a dependency on target.h to aarch64-c.o in t-aarch64,
which looks correct.

Thanks,
James

---
2016-11-01  James Greenhalgh  <james.greenhalgh@arm.com>

	* config/aarch64/t-aarch64 (aarch64-c.o): Depend on TARGET_H.

Comments

Richard Earnshaw (lists) Nov. 8, 2016, 9:40 a.m. UTC | #1
On 01/11/16 13:58, James Greenhalgh wrote:
> 

> Hi,

> 

> I've noticed that aarch64-c.o doesn't get rebuilt after a change to

> the target hooks. That leaves it out of sync with the rest of the compiler

> in incremental builds, which in turn causes this code to write to the wrong

> memory location:

> 

>   void

>   aarch64_register_pragmas (void)

>   {

>     /* Update pragma hook to allow parsing #pragma GCC target.  */

>     targetm.target_option.pragma_parse = aarch64_pragma_target_parse;

>   }

> 

> Leaving pragma_parse pointing at the default implementation, and mangling

> poor innocent targetm.target_option.print (which generally we don't use

> after the rebuild - else we likely would see it here too).

> 

> This change adds a dependency on target.h to aarch64-c.o in t-aarch64,

> which looks correct.

> 

> Thanks,

> James

> 

> ---

> 2016-11-01  James Greenhalgh  <james.greenhalgh@arm.com>

> 

> 	* config/aarch64/t-aarch64 (aarch64-c.o): Depend on TARGET_H.

> 


OK.

Seems pretty obvious...

R.

> 

> 0001-Patch-AArch64-aarch64-c.o-should-depend-on-TARGET_H.patch

> 

> 

> diff --git a/gcc/config/aarch64/t-aarch64 b/gcc/config/aarch64/t-aarch64

> index 04eb636..b461eb5 100644

> --- a/gcc/config/aarch64/t-aarch64

> +++ b/gcc/config/aarch64/t-aarch64

> @@ -52,7 +52,7 @@ aarch-common.o: $(srcdir)/config/arm/aarch-common.c $(CONFIG_H) $(SYSTEM_H) \

>  		$(srcdir)/config/arm/aarch-common.c

>  

>  aarch64-c.o: $(srcdir)/config/aarch64/aarch64-c.c $(CONFIG_H) $(SYSTEM_H) \

> -    coretypes.h $(TM_H) $(TREE_H) output.h $(C_COMMON_H)

> +    coretypes.h $(TM_H) $(TREE_H) output.h $(C_COMMON_H) $(TARGET_H)

>  	$(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \

>  		$(srcdir)/config/aarch64/aarch64-c.c

>  

>
diff mbox

Patch

diff --git a/gcc/config/aarch64/t-aarch64 b/gcc/config/aarch64/t-aarch64
index 04eb636..b461eb5 100644
--- a/gcc/config/aarch64/t-aarch64
+++ b/gcc/config/aarch64/t-aarch64
@@ -52,7 +52,7 @@  aarch-common.o: $(srcdir)/config/arm/aarch-common.c $(CONFIG_H) $(SYSTEM_H) \
 		$(srcdir)/config/arm/aarch-common.c
 
 aarch64-c.o: $(srcdir)/config/aarch64/aarch64-c.c $(CONFIG_H) $(SYSTEM_H) \
-    coretypes.h $(TM_H) $(TREE_H) output.h $(C_COMMON_H)
+    coretypes.h $(TM_H) $(TREE_H) output.h $(C_COMMON_H) $(TARGET_H)
 	$(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
 		$(srcdir)/config/aarch64/aarch64-c.c