public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/50996] New: segfault cross-compiling for lm32
@ 2011-11-05 17:06 rubini at gnudd dot com
  2011-11-05 17:21 ` [Bug c/50996] " rubini at gnudd dot com
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: rubini at gnudd dot com @ 2011-11-05 17:06 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 50996
           Summary: segfault cross-compiling for lm32
    Classification: Unclassified
           Product: gcc
           Version: 4.6.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: rubini@gnudd.com


Created attachment 25728
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25728
Minimal file that causes the segfault

This may be similar to bug 50927 and maybe 46898.

The compiler segfault on an apparently simple (but ugly) newlib file.
I removed command line options from the complete command to get
the minimum failing case. I also trimmed the preprocessed file
to the minimum, thich I attach.

The original file is envz-entry.c for newlib 1.18.0 or 1.19.0.
The same segfault happens with 4.6.1 and 4.6.2

With -O1 it segfaults like with -O2 (which I got in my log file).

    spusa$ /data/spusa/lm32/build-111105-17-10/./gcc/xgcc
-B/data/spusa/lm32/build-111105-17-10/./gcc/   -O1 -c /tmp/x.c
    xgcc: internal compiler error: Segmentation fault (program cc1)
    Please submit a full bug report,
    with preprocessed source if appropriate.
    See <http://gcc.gnu.org/bugs.html> for instructions.


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

* [Bug c/50996] segfault cross-compiling for lm32
  2011-11-05 17:06 [Bug c/50996] New: segfault cross-compiling for lm32 rubini at gnudd dot com
@ 2011-11-05 17:21 ` rubini at gnudd dot com
  2011-12-15  0:22 ` [Bug target/50996] " pinskia at gcc dot gnu.org
  2014-03-02 22:00 ` lekernel at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: rubini at gnudd dot com @ 2011-11-05 17:21 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Alessandro Rubini <rubini at gnudd dot com> 2011-11-05 17:20:41 UTC ---

I removed more stuff. What follows is the minimal file that triggers
the error. Swapping the && operands won't make it segfault



void
envz_entry(char *envz)
{
  char *buf_ptr = (char *)envz;

  while(1)
      while(*buf_ptr && buf_ptr != envz)
          buf_ptr--;
}


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

* [Bug target/50996] segfault cross-compiling for lm32
  2011-11-05 17:06 [Bug c/50996] New: segfault cross-compiling for lm32 rubini at gnudd dot com
  2011-11-05 17:21 ` [Bug c/50996] " rubini at gnudd dot com
@ 2011-12-15  0:22 ` pinskia at gcc dot gnu.org
  2014-03-02 22:00 ` lekernel at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2011-12-15  0:22 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> 2011-12-15 00:20:31 UTC ---
It works for me on the trunk, configured with --target=lm32-elf.


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

* [Bug target/50996] segfault cross-compiling for lm32
  2011-11-05 17:06 [Bug c/50996] New: segfault cross-compiling for lm32 rubini at gnudd dot com
  2011-11-05 17:21 ` [Bug c/50996] " rubini at gnudd dot com
  2011-12-15  0:22 ` [Bug target/50996] " pinskia at gcc dot gnu.org
@ 2014-03-02 22:00 ` lekernel at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: lekernel at gcc dot gnu.org @ 2014-03-02 22:00 UTC (permalink / raw)
  To: gcc-bugs

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

Sebastien Bourdeauducq <lekernel at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
                 CC|                            |lekernel at gcc dot gnu.org
         Resolution|---                         |FIXED

--- Comment #3 from Sebastien Bourdeauducq <lekernel at gcc dot gnu.org> ---
Just checked it works with the current trunk (after Jon Beniston's recent
patch).


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

end of thread, other threads:[~2014-03-02 22:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-05 17:06 [Bug c/50996] New: segfault cross-compiling for lm32 rubini at gnudd dot com
2011-11-05 17:21 ` [Bug c/50996] " rubini at gnudd dot com
2011-12-15  0:22 ` [Bug target/50996] " pinskia at gcc dot gnu.org
2014-03-02 22:00 ` lekernel at gcc dot gnu.org

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).