This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: gcc optimizer problem, 2.8.1 upwards


> the snippet below contains (standalone) C-code that is mistakeably
> optimized-to-nothing by gcc optimizer any level of optimization). i have
> tried it on gcc 272(linux&solaris), gcc 281 (djgpp), egcs2.91 (cygwin20b1
> & solaris 2.5). 
> gcc2.7.2 is ok. anything above seems to be wrong.

Thanks for your bug report. gcc-2.95.2 produces the output

-pass 3920 
- got 3920 [3920] - ok
-pass 4de0 
- got 4d00 [4d00] - ok
-pass 4d00 
- got 4d00 [4d00] - ok
-pass 80e0 
- got 80e0 [80e0] - ok

on i586-pc-linux-gnu. You did not report what output the program gives
for the versions you've tested. I tried egcs 2.91.66, it says

-pass 3920 
- got 3920 [3920] - ok
-pass 4de0 
- got 4de0 [4d00] - wrong!
-pass 4d00 
- got 4d00 [4d00] - ok
-pass 80e0 
- got 80e0 [80e0] - ok

so it seems the bug is fixed in the most recent version (i.e. 2.95)


> i won't say it is good or bad, it's much nearer to good, but that's no
> reason to disallow other compilers (read the man/info for "-pedantic" -
> playing evangelists, trying to convert people or what? it's not so bad,
> but its a bit irritating)

Not sure what you're referring to. That gcc provides that option? or
that the documentation says it has surprising effects? 

Take, for example, long long (i.e. 64 bit integers). This is a very
useful feature, and even used in Linux system headers files. Yet, it
is not part of ISO C90 (it is part of the recently accepted C99
standard). 

People using "long long" in their programs don't write ANSI C. Most
don't care, but some would like to know that they are violating the
ANSI rules when using it. So there is -pedantic.

Regards,
Martin


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]