public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Adding constraints.md to my port
@ 2009-07-14 18:30 Jean Christophe Beyler
  2009-07-14 19:53 ` Ian Lance Taylor
  0 siblings, 1 reply; 5+ messages in thread
From: Jean Christophe Beyler @ 2009-07-14 18:30 UTC (permalink / raw)
  To: gcc

Dear all,

I'm continuing this port and have run into something strange, if I add
a constraints.md file with only this:
(define_constraint "I"
  "A signed 16-bit constant (for arithmetic instructions)."
  (and (match_code "const_int")
       (match_test "SMALL_OPERAND (ival)")))

(Like one of the constraints from the mips port).

And add a :
(include "constraints.md")

to my md file, I get these during the compilation:
In file included from ./tm_p.h:5,
                 from /home/toto/gcc-4.3.2/gcc/c-pragma.c:35:
./tm-preds.h:40:1: warning: "CONSTRAINT_LEN" redefined
In file included from ./tm.h:6,
                 from /home/toto/gcc-4.3.2/gcc/c-pragma.c:24:
/home/toto/gcc-4.3.2/gcc/defaults.h:797:1: warning: this is the
location of the previous definition
In file included from ./tm_p.h:5,
                 from /home/toto/gcc-4.3.2/gcc/c-pragma.c:35:
./tm-preds.h:42:1: warning: "REG_CLASS_FROM_CONSTRAINT" redefined
In file included from ./tm.h:6,
                 from /home/toto/gcc-4.3.2/gcc/c-pragma.c:24:
/home/toto/gcc-4.3.2/gcc/defaults.h:810:1: warning: this is the
location of the previous definition
In file included from ./tm_p.h:5,
                 from /home/toto/gcc-4.3.2/gcc/c-pragma.c:35:
./tm-preds.h:44:1: warning: "CONST_OK_FOR_CONSTRAINT_P" redefined
In file included from ./tm.h:6,
                 from /home/toto/gcc-4.3.2/gcc/c-pragma.c:24:
/home/toto/gcc-4.3.2/gcc/defaults.h:801:1: warning: this is the
location of the previous definition
In file included from ./tm_p.h:5,
                 from /home/toto/gcc-4.3.2/gcc/c-pragma.c:35:
./tm-preds.h:47:1: warning: "CONST_DOUBLE_OK_FOR_CONSTRAINT_P" redefined
In file included from ./tm.h:6,
                 from /home/toto/gcc-4.3.2/gcc/c-pragma.c:24:
/home/toto/gcc-4.3.2/gcc/defaults.h:805:1: warning: this is the
location of the previous definition
In file included from ./tm_p.h:5,
                 from /home/toto/gcc-4.3.2/gcc/c-pragma.c:35:
./tm-preds.h:49:1: warning: "EXTRA_MEMORY_CONSTRAINT" redefined
In file included from ./tm.h:6,
                 from /home/toto/gcc-4.3.2/gcc/c-pragma.c:24:
/home/toto/gcc-4.3.2/gcc/defaults.h:781:1: warning: this is the
location of the previous definition
In file included from ./tm_p.h:5,
                 from /home/toto/gcc-4.3.2/gcc/c-pragma.c:35:
./tm-preds.h:51:1: warning: "EXTRA_ADDRESS_CONSTRAINT" redefined


Any ideas why this happens when I add a constraint to my machine description?

As always, thank you very much for your time,
Jean Christophe Beyler

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Adding constraints.md to my port
  2009-07-14 18:30 Adding constraints.md to my port Jean Christophe Beyler
@ 2009-07-14 19:53 ` Ian Lance Taylor
  2009-07-14 20:31   ` Jean Christophe Beyler
  0 siblings, 1 reply; 5+ messages in thread
From: Ian Lance Taylor @ 2009-07-14 19:53 UTC (permalink / raw)
  To: Jean Christophe Beyler; +Cc: gcc

Jean Christophe Beyler <jean.christophe.beyler@gmail.com> writes:

> In file included from ./tm_p.h:5,
>                  from /home/toto/gcc-4.3.2/gcc/c-pragma.c:35:
> ./tm-preds.h:40:1: warning: "CONSTRAINT_LEN" redefined
> In file included from ./tm.h:6,
>                  from /home/toto/gcc-4.3.2/gcc/c-pragma.c:24:
> /home/toto/gcc-4.3.2/gcc/defaults.h:797:1: warning: this is the
> location of the previous definition

See defaults.h:

#if  !defined CONSTRAINT_LEN			\
  && !defined REG_CLASS_FROM_LETTER		\
  && !defined REG_CLASS_FROM_CONSTRAINT		\
  && !defined CONST_OK_FOR_LETTER_P		\
  && !defined CONST_OK_FOR_CONSTRAINT_P		\
  && !defined CONST_DOUBLE_OK_FOR_LETTER_P	\
  && !defined CONST_DOUBLE_OK_FOR_CONSTRAINT_P  \
  && !defined EXTRA_CONSTRAINT			\
  && !defined EXTRA_CONSTRAINT_STR		\
  && !defined EXTRA_MEMORY_CONSTRAINT		\
  && !defined EXTRA_ADDRESS_CONSTRAINT

#define USE_MD_CONSTRAINTS


Make sure that your CPU.h file does not define any of those macros.

Ian

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Adding constraints.md to my port
  2009-07-14 19:53 ` Ian Lance Taylor
@ 2009-07-14 20:31   ` Jean Christophe Beyler
  2009-07-15  5:30     ` Paolo Bonzini
  0 siblings, 1 reply; 5+ messages in thread
From: Jean Christophe Beyler @ 2009-07-14 20:31 UTC (permalink / raw)
  To: Ian Lance Taylor; +Cc: gcc

Ok, so actually, my cpu.h file had some of those included. I've
removed them and am now filling in the constraints.md file with what
is needed. I also so that they were obsolete in the GCC internals,
I'll be moving everything to the constraints then.

Thank you for your help,
Jc

On Tue, Jul 14, 2009 at 3:53 PM, Ian Lance Taylor<iant@google.com> wrote:
> Jean Christophe Beyler <jean.christophe.beyler@gmail.com> writes:
>
>> In file included from ./tm_p.h:5,
>>                  from /home/toto/gcc-4.3.2/gcc/c-pragma.c:35:
>> ./tm-preds.h:40:1: warning: "CONSTRAINT_LEN" redefined
>> In file included from ./tm.h:6,
>>                  from /home/toto/gcc-4.3.2/gcc/c-pragma.c:24:
>> /home/toto/gcc-4.3.2/gcc/defaults.h:797:1: warning: this is the
>> location of the previous definition
>
> See defaults.h:
>
> #if  !defined CONSTRAINT_LEN                    \
>  && !defined REG_CLASS_FROM_LETTER             \
>  && !defined REG_CLASS_FROM_CONSTRAINT         \
>  && !defined CONST_OK_FOR_LETTER_P             \
>  && !defined CONST_OK_FOR_CONSTRAINT_P         \
>  && !defined CONST_DOUBLE_OK_FOR_LETTER_P      \
>  && !defined CONST_DOUBLE_OK_FOR_CONSTRAINT_P  \
>  && !defined EXTRA_CONSTRAINT                  \
>  && !defined EXTRA_CONSTRAINT_STR              \
>  && !defined EXTRA_MEMORY_CONSTRAINT           \
>  && !defined EXTRA_ADDRESS_CONSTRAINT
>
> #define USE_MD_CONSTRAINTS
>
>
> Make sure that your CPU.h file does not define any of those macros.
>
> Ian
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Adding constraints.md to my port
  2009-07-14 20:31   ` Jean Christophe Beyler
@ 2009-07-15  5:30     ` Paolo Bonzini
  2009-07-15 15:22       ` Jean Christophe Beyler
  0 siblings, 1 reply; 5+ messages in thread
From: Paolo Bonzini @ 2009-07-15  5:30 UTC (permalink / raw)
  To: Jean Christophe Beyler; +Cc: Ian Lance Taylor, gcc

On 07/14/2009 10:31 PM, Jean Christophe Beyler wrote:
> Ok, so actually, my cpu.h file had some of those included. I've
> removed them and am now filling in the constraints.md file with what
> is needed. I also so that they were obsolete in the GCC internals,
> I'll be moving everything to the constraints then.

That's good, it's usually much more readable.  However, as you found 
out, it's an "all or nothing" decision for each port.

Paolo

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Adding constraints.md to my port
  2009-07-15  5:30     ` Paolo Bonzini
@ 2009-07-15 15:22       ` Jean Christophe Beyler
  0 siblings, 0 replies; 5+ messages in thread
From: Jean Christophe Beyler @ 2009-07-15 15:22 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: Ian Lance Taylor, gcc

I agree. I've actually pretty much finished that change and it seems
to be stable. I think it will be more maintainable in the
constraints.md state than it was before,

Thanks again,
Jc

On Wed, Jul 15, 2009 at 1:30 AM, Paolo Bonzini<bonzini@gnu.org> wrote:
> On 07/14/2009 10:31 PM, Jean Christophe Beyler wrote:
>>
>> Ok, so actually, my cpu.h file had some of those included. I've
>> removed them and am now filling in the constraints.md file with what
>> is needed. I also so that they were obsolete in the GCC internals,
>> I'll be moving everything to the constraints then.
>
> That's good, it's usually much more readable.  However, as you found out,
> it's an "all or nothing" decision for each port.
>
> Paolo
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-07-15 15:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-07-14 18:30 Adding constraints.md to my port Jean Christophe Beyler
2009-07-14 19:53 ` Ian Lance Taylor
2009-07-14 20:31   ` Jean Christophe Beyler
2009-07-15  5:30     ` Paolo Bonzini
2009-07-15 15:22       ` Jean Christophe Beyler

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).