Patchwork breaking cris-elf build with "Re: [RTL] move rtl diagnostics out of toplev.h"

login
register
mail settings
Submitter Manuel López-Ibáñez
Date June 30, 2010, 11:17 p.m.
Message ID <AANLkTikWdqpG7-PCMAwYD4KlurgBWrGwlXl5RE9RS3uw@mail.gmail.com>
Download mbox | patch
Permalink /patch/57459/
State New
Headers show

Comments

Manuel López-Ibáñez - June 30, 2010, 11:17 p.m.
On 1 July 2010 01:07, Hans-Peter Nilsson <hp@bitrange.com> wrote:
> On Thu, 1 Jul 2010, Manuel López-Ibáñez wrote:
>> On 1 July 2010 00:05, Hans-Peter Nilsson <hp@bitrange.com> wrote:
>> > libbackend.a(recog.o): In function `constrain_operands':
>> > /tmp/hpautotest-gcc1/gcc/gcc/recog.c:2616: undefined reference
>> > to `exact_log2'
>> > libbackend.a(recog.o): In function `asm_operand_ok':
>> > /tmp/hpautotest-gcc1/gcc/gcc/recog.c:1756: undefined reference
>> > to `exact_log2'
>> > libbackend.a(reload.o): In function `find_reloads':
>> > /tmp/hpautotest-gcc1/gcc/gcc/reload.c:3363: undefined reference
>> > to `exact_log2'
>> > collect2: ld returned 1 exit status
>> >
>> > with "warning: implicit declaration of function 'exact_log2'"
>> > when compiling reload.c and recog.c, probably due to exact_log2
>> > being used in CONST_OK_FOR_CONSTRAINT_P.
>> >
>> > I'm lost in this new scheme of moving includes around, but you
>> > should know.  What's the best course of action besides moving to
>> > constraints.md?
>>
>> For every file that produces such error, just include toplev.h
>>
>> #include "toplev.h" /* exact_log2 */
>>
>> after everything else. I will do it for you if you give me the list of
>> files affected.
>
> Thanks, the list seen in the quoted buildlog above is complete.
>
> brgds, H-P

Richard, can I commit the following patch to fix the breakage or you
want me to wait until the merge is over?

2010-06-30  Manuel López-Ibáñez  <manu@gcc.gnu.org>

	* reload.c: Include toplev.h.
	* recog.c:  Likewise.
	* Makefile.in: Adjust dependencies.

BTW, is there a rule against targets including the headers that they
need. Can .md files include headers?

Manuel.
Andrew Pinski - June 30, 2010, 11:23 p.m.
On Wed, Jun 30, 2010 at 4:17 PM, Manuel López-Ibáñez
<lopezibanez@gmail.com> wrote:
> BTW, is there a rule against targets including the headers that they
> need. Can .md files include headers?

rs6000 uses exact_log2 in its constraints.md.  This works because
genpreds.c creates a source file which includes toplev.h.  See
genpreds.c:1340.  I think someone should go through those includes
also.

Thanks,
Andrew Pinski
Manuel López-Ibáñez - June 30, 2010, 11:29 p.m.
On 1 July 2010 01:23, Andrew Pinski <pinskia@gmail.com> wrote:
> On Wed, Jun 30, 2010 at 4:17 PM, Manuel López-Ibáñez
> <lopezibanez@gmail.com> wrote:
>> BTW, is there a rule against targets including the headers that they
>> need. Can .md files include headers?
>
> rs6000 uses exact_log2 in its constraints.md.  This works because
> genpreds.c creates a source file which includes toplev.h.  See
> genpreds.c:1340.  I think someone should go through those includes
> also.

But I didn't touch that file and toplev.h still contains exact_log2,
so what is going on?

Manuel.
Andrew Pinski - June 30, 2010, 11:31 p.m.
On Wed, Jun 30, 2010 at 4:29 PM, Manuel López-Ibáñez
<lopezibanez@gmail.com> wrote:
> On 1 July 2010 01:23, Andrew Pinski <pinskia@gmail.com> wrote:
>> On Wed, Jun 30, 2010 at 4:17 PM, Manuel López-Ibáñez
>> <lopezibanez@gmail.com> wrote:
>>> BTW, is there a rule against targets including the headers that they
>>> need. Can .md files include headers?
>>
>> rs6000 uses exact_log2 in its constraints.md.  This works because
>> genpreds.c creates a source file which includes toplev.h.  See
>> genpreds.c:1340.  I think someone should go through those includes
>> also.
>
> But I didn't touch that file and toplev.h still contains exact_log2,
> so what is going on?

Easy, Cris has not be converted over to use define_constraint yet.

Thanks,
Andrew Pinski
Hans-Peter Nilsson - July 1, 2010, 1:47 p.m.
On Thu, 1 Jul 2010, Manuel López-Ibáñez wrote:
> Richard, can I commit the following patch to fix the breakage or you
> want me to wait until the merge is over?

Richi ok'd this on IRC, so I verified that it fixed the
build problem and committed it on behalf of you.  Thanks.

> 2010-06-30  Manuel López-Ibáñez  <manu@gcc.gnu.org>
>
> 	* reload.c: Include toplev.h.
> 	* recog.c:  Likewise.
> 	* Makefile.in: Adjust dependencies.

brgds, H-P

Patch

Index: gcc/recog.c
===================================================================
--- gcc/recog.c	(revision 161633)
+++ gcc/recog.c	(working copy)
@@ -42,6 +42,7 @@ 
 #include "timevar.h"
 #include "tree-pass.h"
 #include "df.h"
+#include "toplev.h" /* exact_log2 may be used by targets */
 
 #ifndef STACK_PUSH_CODE
 #ifdef STACK_GROWS_DOWNWARD
Index: gcc/reload.c
===================================================================
--- gcc/reload.c	(revision 161633)
+++ gcc/reload.c	(working copy)
@@ -111,6 +111,7 @@ 
 #include "params.h"
 #include "target.h"
 #include "ira.h"
+#include "toplev.h" /* exact_log2 may be used by targets */
 
 /* True if X is a constant that can be forced into the constant pool.  */
 #define CONST_POOL_OK_P(X)			\
Index: gcc/Makefile.in
===================================================================
--- gcc/Makefile.in	(revision 161633)
+++ gcc/Makefile.in	(working copy)
@@ -3269,7 +3269,7 @@ 
 reload.o : reload.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_ERROR_H) \
    $(FLAGS_H) output.h $(EXPR_H) $(OPTABS_H) reload.h $(RECOG_H) \
    hard-reg-set.h insn-config.h $(REGS_H) $(FUNCTION_H) real.h \
-   addresses.h $(TM_P_H) $(PARAMS_H) $(TARGET_H) $(DF_H) ira.h
+   addresses.h $(TM_P_H) $(PARAMS_H) $(TARGET_H) $(DF_H) ira.h $(TOPLEV_H)
 reload1.o : reload1.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_ERROR_H) \
    $(EXPR_H) $(OPTABS_H) reload.h $(REGS_H) hard-reg-set.h insn-config.h \
    $(BASIC_BLOCK_H) $(RECOG_H) output.h $(FUNCTION_H)  $(TM_P_H) \
@@ -3409,7 +3409,7 @@ 
    $(FUNCTION_H) $(BASIC_BLOCK_H) $(REGS_H) $(RECOG_H) $(EXPR_H) \
    $(FLAGS_H) insn-config.h $(INSN_ATTR_H) output.h reload.h \
    addresses.h $(TM_P_H) $(TIMEVAR_H) $(TREE_PASS_H) hard-reg-set.h \
-   $(DF_H) $(DBGCNT_H) $(TARGET_H)
+   $(DF_H) $(DBGCNT_H) $(TARGET_H) $(TOPLEV_H)
 reg-stack.o : reg-stack.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
    $(RTL_ERROR_H) $(TREE_H) $(RECOG_H) $(REGS_H) hard-reg-set.h $(FLAGS_H) \
    insn-config.h reload.h $(FUNCTION_H) $(TM_P_H) $(GGC_H) \