public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/44081]  New: Incorrect nonnull assumed in code generation
@ 2010-05-11 14:41 hv at crypt dot org
  2010-05-11 14:41 ` [Bug c/44081] " hv at crypt dot org
                   ` (9 more replies)
  0 siblings, 10 replies; 14+ messages in thread
From: hv at crypt dot org @ 2010-05-11 14:41 UTC (permalink / raw)
  To: gcc-bugs

zen% /opt/gcc-4.5.0/bin/gcc -v
Using built-in specs.
COLLECT_GCC=/opt/gcc-4.5.0/bin/gcc
COLLECT_LTO_WRAPPER=/opt/gcc-4.5.0/libexec/gcc/i686-pc-linux-gnu/4.5.0/lto-wrapper
Target: i686-pc-linux-gnu
Configured with: /src/package/lang/other/gcc-4.5.0/configure
--prefix=/opt/gcc-4.5.0 --with-gmp=/opt/gmp-4.2.2 --with-mpfr=/opt/mpfr-2.4.1
--with-mpc=/opt/mpc-0.8.1
Thread model: posix
gcc version 4.5.0 (GCC) 
zen% 

test.S is generated from 'gcc -S -O2 -fno-inline -Wall gcctest2.c -o
gcctest2.S' using gcc-4.5.0. The assembler shows that the function test() does
not check if its third parameter o2 is NULL, but one path in the calling
function peep() does not guarantee that it is nonnull.

I was unable to reproduce this with gcc-4.4.3; I was also unable to reproduce
it without the '__attribute__((nonnull(2)))' declaration - it seems possible
that in some circumstances the nonnull may be getting applied to the wrong
parameter, but that may be a red herring.

This is cut down from a problem found by Alex Hunsaker compiling perl-5.12.1,
where the erroneous generated code caused a segfault
<http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2010-05/msg00316.html>.


-- 
           Summary: Incorrect nonnull assumed in code generation
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: hv at crypt dot org


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


^ permalink raw reply	[flat|nested] 14+ messages in thread
[parent not found: <bug-44081-4@http.gcc.gnu.org/bugzilla/>]

end of thread, other threads:[~2015-07-26 10:29 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-05-11 14:41 [Bug c/44081] New: Incorrect nonnull assumed in code generation hv at crypt dot org
2010-05-11 14:41 ` [Bug c/44081] " hv at crypt dot org
2010-05-11 14:42 ` hv at crypt dot org
2010-05-11 14:51 ` jakub at gcc dot gnu dot org
2010-05-11 15:38 ` hv at crypt dot org
2010-05-11 22:59 ` [Bug middle-end/44081] " pinskia at gcc dot gnu dot org
2010-05-12  5:29 ` pmoulder at mail dot csse dot monash dot edu dot au
2010-05-12  6:26 ` jakub at gcc dot gnu dot org
2010-05-12  9:25 ` pmoulder at mail dot csse dot monash dot edu dot au
2010-05-12 10:55 ` hv at crypt dot org
2010-05-12 11:52 ` joseph at codesourcery dot com
     [not found] <bug-44081-4@http.gcc.gnu.org/bugzilla/>
2010-12-26 22:57 ` nordq at ya dot ru
2011-01-20 19:06 ` nordq at ya dot ru
2015-07-26 10:29 ` hv at crypt dot 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).