public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* cpp macro expansion bug/query
@ 1999-05-31 21:06 Barrie Treloar
1999-06-30 23:07 ` cpp macro expansion bug/query boundary="------------32D99FAAC36ABE0FE8FB5C3E" Barrie Treloar
0 siblings, 1 reply; 2+ messages in thread
From: Barrie Treloar @ 1999-05-31 21:06 UTC (permalink / raw)
To: egcs-bugs, barrie
Hi,
When using gcc -E, or cpp, I find that an argument to a macro
is expanded with a single leading and a single trailing space.
This is not what I expected. I'm not sure if this is what is meant
to happen (at least it doesn't make any sense).
If you use the option -traditional then the macro is expanded correctly,
that is, there are no leading or trailing spaces.
If you use the option -ansi (or no options) then the macro is expanded
incorrectly.
I have attached the test file (foo), with the output from both the
-traditional (foo.traditional) and -ansi (foo.ansi) options.
I am running this in the following environment:
Windows 98 (4.10.1998)
Cygwin toolset (gcc --version: egcs-2.91.57)
Command invoked:
gcc -E -x c -ansi foo
gcc -E -x c -traditional foo
Any suggestions appreciated.
Thanks
Barrie.
# 1 "foo"
Here is the expansion : . foo .
>From law@upchuck.cygnus.com Mon May 31 21:06:00 1999
From: Jeffrey A Law <law@upchuck.cygnus.com>
To: David Edelsohn <dje@watson.ibm.com>
Cc: Franz Sirl <Franz.Sirl-kernel@lauterbach.com>, egcs-bugs@egcs.cygnus.com
Subject: Re: gcc-2.95pre: Internal compiler error in `gen_add2_insn'
Date: Mon, 31 May 1999 21:06:00 -0000
Message-id: <1379.927792884@upchuck.cygnus.com>
References: <9905261734.AA27034@marc.watson.ibm.com>
X-SW-Source: 1999-05n/msg00715.html
Content-length: 923
In message < 9905261734.AA27034@marc.watson.ibm.com >you write:
> gen_reload() is designed to handle a failure from
> emit_insn(gen_add2_insn()), but it is designed to handle a different type
> of failure. The call to gen_add2_insn() is not protected from predicate
> mismatches by that stage.
>
> Maybe gen_add2_insn() and gen_sub2_insn() should return
> CODE_FOR_nothing instead of aborting. I am not sure of the consequences
> elsewhere in the compiler and their ability to handle that type of return
> value. On the other hand, that is what they should get for another type
> of failure mode that they seem to be able to handle.
Actually, I think we need to make the generic addsi/addi3 expander handle
the counter register.
I'm not sure if it's doc'd anywhere, but the add patterns are considered
special much like the movxx patterns and need to handle some of these
oddball cases.
jeff
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: cpp macro expansion bug/query boundary="------------32D99FAAC36ABE0FE8FB5C3E"
1999-05-31 21:06 cpp macro expansion bug/query Barrie Treloar
@ 1999-06-30 23:07 ` Barrie Treloar
0 siblings, 0 replies; 2+ messages in thread
From: Barrie Treloar @ 1999-06-30 23:07 UTC (permalink / raw)
To: Barrie Treloar; +Cc: egcs-bugs
On Sun, 16 May 1999, Barrie Treloar wrote:
I have not received any confirmation that this message has been
received. Should I be expecting any such message?
I'm not really after an answer, but one would not hurt, as I already
have a work around.
regards,
> Hi,
> When using gcc -E, or cpp, I find that an argument to a macro
> is expanded with a single leading and a single trailing space.
>
> This is not what I expected. I'm not sure if this is what is meant
> to happen (at least it doesn't make any sense).
>
> If you use the option -traditional then the macro is expanded correctly,
> that is, there are no leading or trailing spaces.
>
> If you use the option -ansi (or no options) then the macro is expanded
> incorrectly.
>
> I have attached the test file (foo), with the output from both the
> -traditional (foo.traditional) and -ansi (foo.ansi) options.
>
> I am running this in the following environment:
> Windows 98 (4.10.1998)
> Cygwin toolset (gcc --version: egcs-2.91.57)
>
> Command invoked:
> gcc -E -x c -ansi foo
> gcc -E -x c -traditional foo
>
> Any suggestions appreciated.
>
> Thanks
>
> Barrie.
Barrie
--
Barrie Treloar
____________________________________________________________________
Barrie Treloar Phone: +61 8 8303 3300
Senior Analyst/Programmer Fax: +61 8 8303 4403
Electronic Commerce Division Email: barrie@camtech.com.au
Camtech (SA) Pty Ltd http://www.camtech.com.au
--- Level 8, 10 Pulteney Street, Adelaide SA 5000, Australia. ---
____________________________________________________________________
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~1999-06-30 23:07 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-05-31 21:06 cpp macro expansion bug/query Barrie Treloar
1999-06-30 23:07 ` cpp macro expansion bug/query boundary="------------32D99FAAC36ABE0FE8FB5C3E" Barrie Treloar
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).