public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/38660] New: Pointer value changed to NULL
@ 2008-12-29 17:19 q at ping dot be
2008-12-29 17:20 ` [Bug c/38660] " q at ping dot be
` (15 more replies)
0 siblings, 16 replies; 17+ messages in thread
From: q at ping dot be @ 2008-12-29 17:19 UTC (permalink / raw)
To: gcc-bugs
Hi,
It seems that postgresql has a problem with a gcc 4.4 snapshot. I've last
tested this with the gcc-snapshot package from Debian on x86_64 that has a
snapshot from 20081213.
It seems that a pointer gets changed into NULL that shouldn't. I've first
asked about this on the pgsql list, see the thread starting at
http://archives.postgresql.org/pgsql-hackers/2008-12/msg01813.php
Kurt
--
Summary: Pointer value changed to NULL
Product: gcc
Version: 4.4.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: q at ping dot be
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38660
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug c/38660] Pointer value changed to NULL
2008-12-29 17:19 [Bug c/38660] New: Pointer value changed to NULL q at ping dot be
@ 2008-12-29 17:20 ` q at ping dot be
2008-12-29 18:06 ` [Bug middle-end/38660] " pinskia at gcc dot gnu dot org
` (14 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: q at ping dot be @ 2008-12-29 17:20 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from q at ping dot be 2008-12-29 17:19 -------
Created an attachment (id=17001)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17001&action=view)
preprocessed file that has the problem
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38660
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug middle-end/38660] Pointer value changed to NULL
2008-12-29 17:19 [Bug c/38660] New: Pointer value changed to NULL q at ping dot be
2008-12-29 17:20 ` [Bug c/38660] " q at ping dot be
@ 2008-12-29 18:06 ` pinskia at gcc dot gnu dot org
2008-12-29 18:07 ` pinskia at gcc dot gnu dot org
` (13 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-12-29 18:06 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from pinskia at gcc dot gnu dot org 2008-12-29 18:04 -------
plpython.c:2196: warning: dereferencing type-punned pointer will break
strict-aliasing rules
plpython.c:2196: warning: dereferencing pointer '_Py_TrueStruct.537' does break
strict-aliasing rules
plpython.c:2196: warning: dereferencing pointer '_Py_TrueStruct.537' does break
strict-aliasing rules
plpython.c:2956: warning: variable 'xmsg' might be clobbered by 'longjmp' or
'vfork'
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38660
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug middle-end/38660] Pointer value changed to NULL
2008-12-29 17:19 [Bug c/38660] New: Pointer value changed to NULL q at ping dot be
2008-12-29 17:20 ` [Bug c/38660] " q at ping dot be
2008-12-29 18:06 ` [Bug middle-end/38660] " pinskia at gcc dot gnu dot org
@ 2008-12-29 18:07 ` pinskia at gcc dot gnu dot org
2008-12-29 18:14 ` q at ping dot be
` (12 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-12-29 18:07 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from pinskia at gcc dot gnu dot org 2008-12-29 18:05 -------
( (((PyObject *) &_Py_TrueStruct))->ob_refcnt++);
Yes that is obvious an alias violation.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38660
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug middle-end/38660] Pointer value changed to NULL
2008-12-29 17:19 [Bug c/38660] New: Pointer value changed to NULL q at ping dot be
` (2 preceding siblings ...)
2008-12-29 18:07 ` pinskia at gcc dot gnu dot org
@ 2008-12-29 18:14 ` q at ping dot be
2008-12-29 20:19 ` rguenth at gcc dot gnu dot org
` (11 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: q at ping dot be @ 2008-12-29 18:14 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from q at ping dot be 2008-12-29 18:13 -------
pgsql uses -fno-strict-aliasing to compile.
The command that is being used is:
gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith
-Wdeclaration-after-statement -Wendif-labels -fno-strict-aliasing -fwrapv -g
-fpic -I. -I/usr/include/python2.5 -I../../../src/include -D_GNU_SOURCE -c -o
plpython.o plpython.c
And I only get those warnings:
plpython.c: In function 'PLyDict_FromTuple':
plpython.c:1733: warning: value computed is not used
plpython.c:1733: warning: value computed is not used
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38660
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug middle-end/38660] Pointer value changed to NULL
2008-12-29 17:19 [Bug c/38660] New: Pointer value changed to NULL q at ping dot be
` (3 preceding siblings ...)
2008-12-29 18:14 ` q at ping dot be
@ 2008-12-29 20:19 ` rguenth at gcc dot gnu dot org
2008-12-30 12:46 ` q at ping dot be
` (10 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-12-29 20:19 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from rguenth at gcc dot gnu dot org 2008-12-29 20:18 -------
And actually
plpython.c:2196: warning: dereferencing pointer '_Py_TrueStruct.537' does break
strict-aliasing rules
also means that it doesn't get miscompiled ;)
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38660
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug middle-end/38660] Pointer value changed to NULL
2008-12-29 17:19 [Bug c/38660] New: Pointer value changed to NULL q at ping dot be
` (4 preceding siblings ...)
2008-12-29 20:19 ` rguenth at gcc dot gnu dot org
@ 2008-12-30 12:46 ` q at ping dot be
2009-01-02 13:01 ` q at ping dot be
` (9 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: q at ping dot be @ 2008-12-30 12:46 UTC (permalink / raw)
To: gcc-bugs
------- Comment #6 from q at ping dot be 2008-12-30 12:44 -------
So are you saying that because in an unrelated part of the code there is an
aliasing bug gcc can miscompile anything else, even if -fno-strict-aliasing is
used?
The problem is in the PLy_spi_execute_plan() function. oldcontext ends up
being a NULL pointers while the only place it gets assigned something should
set it to a non-NULL value.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38660
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug middle-end/38660] Pointer value changed to NULL
2008-12-29 17:19 [Bug c/38660] New: Pointer value changed to NULL q at ping dot be
` (5 preceding siblings ...)
2008-12-30 12:46 ` q at ping dot be
@ 2009-01-02 13:01 ` q at ping dot be
2009-01-02 13:03 ` q at ping dot be
` (8 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: q at ping dot be @ 2009-01-02 13:01 UTC (permalink / raw)
To: gcc-bugs
------- Comment #7 from q at ping dot be 2009-01-02 13:00 -------
Created an attachment (id=17021)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17021&action=view)
Reduced test case part 1
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38660
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug middle-end/38660] Pointer value changed to NULL
2008-12-29 17:19 [Bug c/38660] New: Pointer value changed to NULL q at ping dot be
` (6 preceding siblings ...)
2009-01-02 13:01 ` q at ping dot be
@ 2009-01-02 13:03 ` q at ping dot be
2009-01-02 13:05 ` q at ping dot be
` (7 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: q at ping dot be @ 2009-01-02 13:03 UTC (permalink / raw)
To: gcc-bugs
------- Comment #8 from q at ping dot be 2009-01-02 13:01 -------
Created an attachment (id=17022)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17022&action=view)
Reduced test case part 2
--
q at ping dot be changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #17001|0 |1
is obsolete| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38660
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug middle-end/38660] Pointer value changed to NULL
2008-12-29 17:19 [Bug c/38660] New: Pointer value changed to NULL q at ping dot be
` (7 preceding siblings ...)
2009-01-02 13:03 ` q at ping dot be
@ 2009-01-02 13:05 ` q at ping dot be
2009-01-02 20:18 ` pinskia at gcc dot gnu dot org
` (6 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: q at ping dot be @ 2009-01-02 13:05 UTC (permalink / raw)
To: gcc-bugs
------- Comment #9 from q at ping dot be 2009-01-02 13:04 -------
I've reduced the test case. The call to siglongjmp() needs to be in a separate
file.
When the problem occurs the test program returns exit code 1.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38660
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug middle-end/38660] Pointer value changed to NULL
2008-12-29 17:19 [Bug c/38660] New: Pointer value changed to NULL q at ping dot be
` (8 preceding siblings ...)
2009-01-02 13:05 ` q at ping dot be
@ 2009-01-02 20:18 ` pinskia at gcc dot gnu dot org
2009-01-06 23:44 ` kurt at roeckx dot be
` (5 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2009-01-02 20:18 UTC (permalink / raw)
To: gcc-bugs
------- Comment #10 from pinskia at gcc dot gnu dot org 2009-01-02 20:16 -------
This code might turn out to be undefined ...
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38660
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug middle-end/38660] Pointer value changed to NULL
2008-12-29 17:19 [Bug c/38660] New: Pointer value changed to NULL q at ping dot be
` (9 preceding siblings ...)
2009-01-02 20:18 ` pinskia at gcc dot gnu dot org
@ 2009-01-06 23:44 ` kurt at roeckx dot be
2009-01-20 21:19 ` pinskia at gcc dot gnu dot org
` (4 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: kurt at roeckx dot be @ 2009-01-06 23:44 UTC (permalink / raw)
To: gcc-bugs
------- Comment #11 from kurt at roeckx dot be 2009-01-06 23:44 -------
Which part do you think think is undefined and what would you recommend to
resolve it?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38660
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug middle-end/38660] Pointer value changed to NULL
2008-12-29 17:19 [Bug c/38660] New: Pointer value changed to NULL q at ping dot be
` (10 preceding siblings ...)
2009-01-06 23:44 ` kurt at roeckx dot be
@ 2009-01-20 21:19 ` pinskia at gcc dot gnu dot org
2009-01-20 21:36 ` kurt at roeckx dot be
` (3 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2009-01-20 21:19 UTC (permalink / raw)
To: gcc-bugs
------- Comment #12 from pinskia at gcc dot gnu dot org 2009-01-20 21:19 -------
THis is most likely the same issue as PR 38587. Does -fno-ira fix the issue?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38660
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug middle-end/38660] Pointer value changed to NULL
2008-12-29 17:19 [Bug c/38660] New: Pointer value changed to NULL q at ping dot be
` (11 preceding siblings ...)
2009-01-20 21:19 ` pinskia at gcc dot gnu dot org
@ 2009-01-20 21:36 ` kurt at roeckx dot be
2009-01-20 21:41 ` pinskia at gcc dot gnu dot org
` (2 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: kurt at roeckx dot be @ 2009-01-20 21:36 UTC (permalink / raw)
To: gcc-bugs
------- Comment #13 from kurt at roeckx dot be 2009-01-20 21:36 -------
My version of gcc doesn't seem to support the -fno-ira option. Is that
something that needs to be enabled at compile time? Can you try my test case
with that option?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38660
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug middle-end/38660] Pointer value changed to NULL
2008-12-29 17:19 [Bug c/38660] New: Pointer value changed to NULL q at ping dot be
` (12 preceding siblings ...)
2009-01-20 21:36 ` kurt at roeckx dot be
@ 2009-01-20 21:41 ` pinskia at gcc dot gnu dot org
2009-01-20 22:03 ` kurt at roeckx dot be
2009-01-21 20:04 ` hjl dot tools at gmail dot com
15 siblings, 0 replies; 17+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2009-01-20 21:41 UTC (permalink / raw)
To: gcc-bugs
------- Comment #14 from pinskia at gcc dot gnu dot org 2009-01-20 21:41 -------
(In reply to comment #13)
> My version of gcc doesn't seem to support the -fno-ira option.
Well then it is not a snapshot of GCC 4.4.0.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38660
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug middle-end/38660] Pointer value changed to NULL
2008-12-29 17:19 [Bug c/38660] New: Pointer value changed to NULL q at ping dot be
` (13 preceding siblings ...)
2009-01-20 21:41 ` pinskia at gcc dot gnu dot org
@ 2009-01-20 22:03 ` kurt at roeckx dot be
2009-01-21 20:04 ` hjl dot tools at gmail dot com
15 siblings, 0 replies; 17+ messages in thread
From: kurt at roeckx dot be @ 2009-01-20 22:03 UTC (permalink / raw)
To: gcc-bugs
------- Comment #15 from kurt at roeckx dot be 2009-01-20 22:03 -------
I was still using:
gcc (Debian 20081213-1) 4.4.0 20081212 (experimental) [trunk revision 142725]
Which doesn't seem to have that option.
Upgrading to the latest in Debian gives this version:
gcc (Debian 20090107-1) 4.4.0 20090107 (experimental) [trunk revision 143170]
Using that version and the -fno-ira option changes the result of my test case.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38660
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug middle-end/38660] Pointer value changed to NULL
2008-12-29 17:19 [Bug c/38660] New: Pointer value changed to NULL q at ping dot be
` (14 preceding siblings ...)
2009-01-20 22:03 ` kurt at roeckx dot be
@ 2009-01-21 20:04 ` hjl dot tools at gmail dot com
15 siblings, 0 replies; 17+ messages in thread
From: hjl dot tools at gmail dot com @ 2009-01-21 20:04 UTC (permalink / raw)
To: gcc-bugs
------- Comment #16 from hjl dot tools at gmail dot com 2009-01-21 20:03 -------
I am closing it as dup of PR 38587, which will be fixed by
http://gcc.gnu.org/ml/gcc-patches/2009-01/msg01067.html
Please re-open it if the patch above doesn't fix this bug.
*** This bug has been marked as a duplicate of 38587 ***
--
hjl dot tools at gmail dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |DUPLICATE
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38660
^ permalink raw reply [flat|nested] 17+ messages in thread
end of thread, other threads:[~2009-01-21 20:04 UTC | newest]
Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-12-29 17:19 [Bug c/38660] New: Pointer value changed to NULL q at ping dot be
2008-12-29 17:20 ` [Bug c/38660] " q at ping dot be
2008-12-29 18:06 ` [Bug middle-end/38660] " pinskia at gcc dot gnu dot org
2008-12-29 18:07 ` pinskia at gcc dot gnu dot org
2008-12-29 18:14 ` q at ping dot be
2008-12-29 20:19 ` rguenth at gcc dot gnu dot org
2008-12-30 12:46 ` q at ping dot be
2009-01-02 13:01 ` q at ping dot be
2009-01-02 13:03 ` q at ping dot be
2009-01-02 13:05 ` q at ping dot be
2009-01-02 20:18 ` pinskia at gcc dot gnu dot org
2009-01-06 23:44 ` kurt at roeckx dot be
2009-01-20 21:19 ` pinskia at gcc dot gnu dot org
2009-01-20 21:36 ` kurt at roeckx dot be
2009-01-20 21:41 ` pinskia at gcc dot gnu dot org
2009-01-20 22:03 ` kurt at roeckx dot be
2009-01-21 20:04 ` hjl dot tools at gmail dot com
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).