Bug 30286 - [4.1 Regression] Segfault with -O2 -ftrapv
Summary: [4.1 Regression] Segfault with -O2 -ftrapv
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: middle-end (show other bugs)
Version: 4.1.2
: P3 normal
Target Milestone: 4.1.2
Assignee: Jakub Jelinek
URL: http://gcc.gnu.org/ml/gcc-patches/200...
Keywords: ice-on-valid-code
: 30266 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-12-24 04:39 UTC by Andrew Pinski
Modified: 2008-11-11 20:26 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work: 4.0.2 4.1.2 4.2.0 4.3.0
Known to fail:
Last reconfirmed: 2006-12-29 18:45:02


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Pinski 2006-12-24 04:39:56 UTC
Testcase:
struct free_block {
  struct free_block *next;
};
struct mm {
  struct free_block *free_arr[25];
};
void get_exact(int i, struct mm *mm, struct free_block *p)
{
  int j;
  for (j=14; j>i; j--)
      mm->free_arr[j] = p->next;
}
Comment 1 Andrew Pinski 2006-12-24 04:40:19 UTC
*** Bug 30266 has been marked as a duplicate of this bug. ***
Comment 2 Andrew Pinski 2006-12-24 04:41:47 UTC
Confirmed, I created a new bug because the other one was a mess since the preprocessed source was not attached but just pasted.
Comment 3 Jakub Jelinek 2007-01-03 08:04:23 UTC
Subject: Bug 30286

Author: jakub
Date: Wed Jan  3 08:04:11 2007
New Revision: 120387

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=120387
Log:
	PR middle-end/30286
	* gcc.dg/pr30286.c: New test.

Added:
    trunk/gcc/testsuite/gcc.dg/pr30286.c
Modified:
    trunk/gcc/testsuite/ChangeLog

Comment 4 Jakub Jelinek 2007-01-03 08:07:46 UTC
Subject: Bug 30286

Author: jakub
Date: Wed Jan  3 08:07:33 2007
New Revision: 120390

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=120390
Log:
	PR middle-end/30286
	* gcc.dg/pr30286.c: New test.

Added:
    branches/gcc-4_2-branch/gcc/testsuite/gcc.dg/pr30286.c
Modified:
    branches/gcc-4_2-branch/gcc/testsuite/ChangeLog

Comment 5 Jakub Jelinek 2007-01-03 08:15:43 UTC
Subject: Bug 30286

Author: jakub
Date: Wed Jan  3 08:15:24 2007
New Revision: 120393

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=120393
Log:
	PR middle-end/30286
	* fold-const.c (negate_expr): Don't call fold_build1
	for INTEGER_CST or REAL_CST.

	* gcc.dg/pr30286.c: New test.

Added:
    branches/gcc-4_1-branch/gcc/testsuite/gcc.dg/pr30286.c
Modified:
    branches/gcc-4_1-branch/gcc/ChangeLog
    branches/gcc-4_1-branch/gcc/fold-const.c
    branches/gcc-4_1-branch/gcc/testsuite/ChangeLog

Comment 6 Jakub Jelinek 2007-01-03 08:19:36 UTC
Fixed.
Comment 7 Jack Howarth 2008-11-11 15:52:38 UTC
This test case is still failing on i686-apple-darwin9. Shouldn't this PR be reopened?
Comment 8 Richard Biener 2008-11-11 20:26:25 UTC
Please open another bugreport and specify details where it fails (note that
4.1 is no longer maintained)