public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "dick_guertin at yahoo dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/25791] -O2 execution fails, -O and -g work
Date: Mon, 16 Jan 2006 23:16:00 -0000	[thread overview]
Message-ID: <20060116231602.7629.qmail@sourceware.org> (raw)
In-Reply-To: <bug-25791-12018@http.gcc.gnu.org/bugzilla/>



------- Comment #2 from dick_guertin at yahoo dot com  2006-01-16 23:16 -------
See my response below yours.

--- ebotcazou at gcc dot gnu dot org
<gcc-bugzilla@gcc.gnu.org> wrote:

> 
> 
> ------- Comment #1 from ebotcazou at gcc dot gnu dot
> org  2006-01-15 10:01 -------
> We cannot do anything without a reproducer.  See
> http://gcc.gnu.org/bugs.html.
> 
> However, a segfault at runtime on several platforms
> with -O2 and not -O1 may
> hint at an aliasing problem in the code.  You could
> try to recompile everything
> with -O2 -fno-strict-aliasing and see what happens. 
> Read the -fstrict-aliasing
> entry in the manual, section Optimize Options, for
> more information.
> 
> 
> -- 
> 
> ebotcazou at gcc dot gnu dot org changed:
> 
>            What    |Removed                    
> |Added
>
----------------------------------------------------------------------------
>                  CC|                           
> |ebotcazou at gcc dot gnu dot
>                    |                            |org
>            Severity|major                      
> |normal
>              Status|UNCONFIRMED                
> |WAITING
>             Summary|-O2 execution fails using   |-O2
> execution fails, -O and
>                    |3.4.4, -O and -g work       |-g
> work
> 
> 
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25791
> 
> ------- You are receiving this mail because: -------
> You reported the bug, or are watching the reporter.
> 

I tried what you said, adding -fno-strict-aliasing to
my DEFINES statement in the Imakefile.
I then removed all object decks, private libraries,
and the Makefiles, and used 'xmkmf' to
rebuild them .  I then compiled the three
sub-libraries, and then the main code.  All were done
with -O2 and -fno-strict-aliasing.  Execution then
went like this:

elaine30:~/wylsrc> gdb wylbur.ge
GNU gdb 6.3
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General
Public License, and you are
welcome to change it and/or distribute copies of it
under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show
warranty" for details.
This GDB was configured as "sparc-sun-solaris2.8"...
(gdb) run
Starting program:
/afs/ir.stanford.edu/users/g/u/guertin/wylsrc/wylbur.ge


Program received signal SIGILL, Illegal instruction.
0x00297064 in hex_to_character ()
(gdb) where
#0  0x00297064 in hex_to_character ()
#1  0x00297068 in hex_to_character ()
Previous frame identical to this frame (corrupt
stack?)

As you can see, your suggested change did NOT fix the
'problem'.  What is obvious to me is that -O2 is
affecting address computations.  There shouldn't be
any way to clobber the stack unless addresses are
mis-computed or not stored into variables when they
should.  As far as I'm concerned, -O2 is a violation
of the ISO standards concerning Optimization.  If you
need the source code, I can bundle it into a tar.z
file and make it available for download over the web.
I would include a Readme file that explains what MINOR
changes you would have to make to the Imakefile
because this program expects to 'read' tables and
initialization information from files stored in
user-owned subdirectories (the user being YOU, the one
who compiles the code).  This is done so that this
cade can be transported to different sites, owned by
different users.

By the way, I will include 'Imakefile.unix' and
'Imakefile.linux' files for all three subdirectories
and the main code.  That will allow you to compare
Big-Endian to Little-Endian.  Let me know what you
want me to do next.  I'd like to see this -O2 problem fixed!


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25791


  parent reply	other threads:[~2006-01-16 23:16 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-15  7:02 [Bug c/25791] New: -O2 execution fails using 3.4.4, " dick_guertin at yahoo dot com
2006-01-15 10:01 ` [Bug c/25791] -O2 execution fails, " ebotcazou at gcc dot gnu dot org
2006-01-16 23:16 ` dick_guertin at yahoo dot com [this message]
2006-01-16 23:20 ` [Bug rtl-optimization/25791] " pinskia at gcc dot gnu dot org
2006-01-17  1:19 ` dick_guertin at yahoo dot com
2006-01-17  4:35 ` dick_guertin at yahoo dot com
2006-01-17  6:59 ` ebotcazou at gcc dot gnu dot org
2006-01-17  8:33 ` dick_guertin at yahoo dot com
2006-01-17  8:47 ` ebotcazou at gcc dot gnu dot org
2006-01-17 19:01 ` dick_guertin at yahoo dot com
2006-01-17 20:55 ` dick_guertin at yahoo dot com
2006-01-18  3:10 ` dick_guertin at yahoo dot com
2006-01-18 13:31 ` ebotcazou at gcc dot gnu dot org
2006-01-18 13:38 ` ebotcazou at gcc dot gnu dot org
2006-01-19  4:00 ` dick_guertin at yahoo dot com
2006-01-19  4:04 ` pinskia at gcc dot gnu dot org
2006-01-19  4:50 ` dick_guertin at yahoo dot com
2006-01-19  6:41 ` dick_guertin at yahoo dot com
2006-01-19  6:51 ` pinskia at gcc dot gnu dot org
2006-01-19  6:55 ` ebotcazou at gcc dot gnu dot org
2006-01-19  7:46 ` dick_guertin at yahoo dot com
2006-01-19  8:26 ` dick_guertin at yahoo dot com
2006-01-19  8:39 ` ebotcazou at gcc dot gnu dot org
2006-01-19 12:16 ` pinskia at gcc dot gnu dot org
2006-01-19 17:54 ` dick_guertin at yahoo dot com
2006-01-19 18:23 ` dick_guertin at yahoo dot com
2006-01-19 18:33 ` ebotcazou at gcc dot gnu dot org
2006-01-21  8:17 ` dick_guertin at yahoo dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060116231602.7629.qmail@sourceware.org \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).