]> git.ipfire.org Git - thirdparty/gcc.git/commit - gcc/c-family/c-common.c
re PR c/58346 (ICE with SIGFPE at -O1 and above on x86_64-linux-gnu (affecting trunk...
authorMarek Polacek <polacek@redhat.com>
Thu, 23 Jan 2014 19:18:49 +0000 (19:18 +0000)
committerMarek Polacek <mpolacek@gcc.gnu.org>
Thu, 23 Jan 2014 19:18:49 +0000 (19:18 +0000)
commitf04dda3093541436d9ebd3194761ff8199c5ac79
tree9a9f80e007c4a37b50f0d20171385546900224a6
parent789eadcd54ffe62037461a4a22c2737ad9cbd01e
re PR c/58346 (ICE with SIGFPE at -O1 and above on x86_64-linux-gnu (affecting trunk, 4.8, 4.7, and 4.6))

PR c/58346
c-family/
* c-common.c (pointer_to_zero_sized_aggr_p): New function.
* c-common.h: Declare it.
cp/
* typeck.c (pointer_diff): Give an error on arithmetic on pointer to
an empty aggregate.
c/
* c-typeck.c (pointer_diff): Give an error on arithmetic on pointer to
an empty aggregate.
testsuite/
* c-c++-common/pr58346-1.c: New test.
* c-c++-common/pr58346-2.c: New test.
* c-c++-common/pr58346-3.c: New test.

From-SVN: r207004
gcc/c-family/ChangeLog
gcc/c-family/c-common.c
gcc/c-family/c-common.h
gcc/c/ChangeLog
gcc/c/c-typeck.c
gcc/cp/ChangeLog
gcc/cp/typeck.c
gcc/testsuite/ChangeLog
gcc/testsuite/c-c++-common/pr58346-1.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/pr58346-2.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/pr58346-3.c [new file with mode: 0644]