[Bug target/33381] [4.2 regression] miscompilation casting signed long to void*
--- Comment #10 from rguenth at gcc dot gnu dot org 2007-10-10 09:24 --- Fixed. -- rguenth at gcc dot gnu dot org changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution||FIXED http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33381
[Bug target/33381] [4.2 regression] miscompilation casting signed long to void*
--- Comment #9 from rguenth at gcc dot gnu dot org 2007-10-10 09:24 --- Subject: Bug 33381 Author: rguenth Date: Wed Oct 10 09:24:43 2007 New Revision: 129197 URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=129197 Log: 2007-10-10 Richard Guenther [EMAIL PROTECTED] PR tree-optimization/33099 PR tree-optimization/33381 * tree-vrp.c (adjust_range_with_scev): Do not adjust ranges from pointer typed chrecs. * gcc.c-torture/execute/pr33099.c: New testcase. * gcc.c-torture/execute/pr33381.c: Likewise. Added: branches/gcc-4_2-branch/gcc/testsuite/gcc.c-torture/execute/pr33099.c branches/gcc-4_2-branch/gcc/testsuite/gcc.c-torture/execute/pr33381.c Modified: branches/gcc-4_2-branch/gcc/ChangeLog branches/gcc-4_2-branch/gcc/testsuite/ChangeLog branches/gcc-4_2-branch/gcc/tree-vrp.c -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33381
[Bug target/33381] [4.2 regression] miscompilation casting signed long to void*
--- Comment #6 from debian-gcc at lists dot debian dot org 2007-09-25 07:15 --- comparing 4.2 20070902 with 4.2 20070925 + plus the proposed patch, I see two regressions: FAIL: g++.dg/ext/vla4.C (test for errors, line 10) FAIL: g++.dg/other/unused1.C scan-assembler (string|ascii?)z?\\tclass2(|000) Currently checking 20070925 without the proposed patch. Matthias -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33381
[Bug target/33381] [4.2 regression] miscompilation casting signed long to void*
--- Comment #7 from rguenther at suse dot de 2007-09-25 08:25 --- Subject: Re: [4.2 regression] miscompilation casting signed long to void* On Tue, 25 Sep 2007, debian-gcc at lists dot debian dot org wrote: --- Comment #6 from debian-gcc at lists dot debian dot org 2007-09-25 07:15 --- comparing 4.2 20070902 with 4.2 20070925 + plus the proposed patch, I see two regressions: FAIL: g++.dg/ext/vla4.C (test for errors, line 10) FAIL: g++.dg/other/unused1.C scan-assembler (string|ascii?)z?\\tclass2(|000) Currently checking 20070925 without the proposed patch. They also happened w/o the patch for me. Richard. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33381
[Bug target/33381] [4.2 regression] miscompilation casting signed long to void*
--- Comment #8 from debian-gcc at lists dot debian dot org 2007-09-25 13:36 --- Currently checking 20070925 without the proposed patch. They also happened w/o the patch for me. same here, Matthias -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33381
[Bug target/33381] [4.2 regression] miscompilation casting signed long to void*
--- Comment #4 from rguenth at gcc dot gnu dot org 2007-09-21 13:04 --- Shorter testcase: void x(void *data); void test() { long i; for (i = 0; i 5; i++) if (i 0) x((void *)(i - 1)); } -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33381
[Bug target/33381] [4.2 regression] miscompilation casting signed long to void*
--- Comment #5 from rguenth at gcc dot gnu dot org 2007-09-21 13:36 --- This was fixed by the introduction of pointer-plus, which removed all traces of fold_used_pointer* in tree-scalar-evolution.c. A safe patch would go along the following: Index: tree-vrp.c === --- tree-vrp.c (revision 128649) +++ tree-vrp.c (working copy) @@ -2482,6 +2482,13 @@ adjust_range_with_scev (value_range_t *v if (vr-type == VR_ANTI_RANGE) return; + /* Don't try to feed SCEV with casts to pointer type. */ + if (TREE_CODE (stmt) == MODIFY_EXPR + (TREE_CODE (TREE_OPERAND (stmt, 1)) == NOP_EXPR + || TREE_CODE (TREE_OPERAND (stmt, 1)) == CONVERT_EXPR) + POINTER_TYPE_P (TREE_TYPE (TREE_OPERAND (stmt, 1 +return; + chrec = instantiate_parameters (loop, analyze_scalar_evolution (loop, var)); if (TREE_CODE (chrec) != POLYNOMIAL_CHREC) return; -- rguenth at gcc dot gnu dot org changed: What|Removed |Added AssignedTo|unassigned at gcc dot gnu |rguenth at gcc dot gnu dot |dot org |org Status|NEW |ASSIGNED Last reconfirmed|2007-09-11 11:31:46 |2007-09-21 13:36:53 date|| http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33381
[Bug target/33381] [4.2 regression] miscompilation casting signed long to void*
-- pinskia at gcc dot gnu dot org changed: What|Removed |Added Target Milestone|--- |4.2.3 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33381
[Bug target/33381] [4.2 regression] miscompilation casting signed long to void*
--- Comment #2 from rguenth at gcc dot gnu dot org 2007-09-11 11:31 --- A bug in VRP respective its friend SCEV. iin_5 = i_1 - 1; lin_6 = iin_5; pin_7 = (void *) iin_5; iout_8 = iin_5; printf ( %d - In: %d, %ld (%p), Out: %ld\n[0], i_1, iin_5, iin_5, pin_7, iin_5); i_9 = i_1 + 1; (scalar = pin_7) (scalar_evolution = {-1B, +, 1B}_1)) ) (instantiate_parameters (loop_nb = 1) (chrec = {-1B, +, 1B}_1) (res = {-1B, +, 1B}_1)) Found new range for pin_7: [-1B, -1B] Value ranges after VRP: i_1: VARYING i_2: ~[0, 0] EQUIVALENCES: { } (0 elements) iin_5: [-1, 1] EQUIVALENCES: { } (0 elements) lin_6: [-1, 1] EQUIVALENCES: { iin_5 } (1 elements) pin_7: [-1B, -1B] EQUIVALENCES: { } (0 elements) L0:; iin_5 = i_27 - 1; lin_6 = iin_5; pin_7 = (void *) iin_5; iout_8 = iin_5; printf ( %d - In: %d, %ld (%p), Out: %ld\n[0], i_27, iin_5, iin_5, -1B, iin_5); i_9 = i_27 + 1; -- rguenth at gcc dot gnu dot org changed: What|Removed |Added Status|UNCONFIRMED |NEW Ever Confirmed|0 |1 Last reconfirmed|-00-00 00:00:00 |2007-09-11 11:31:46 date|| http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33381
[Bug target/33381] [4.2 regression] miscompilation casting signed long to void*
--- Comment #3 from rguenth at gcc dot gnu dot org 2007-09-11 11:33 --- I think this is related (but not exactly dup) of PR33099. -- rguenth at gcc dot gnu dot org changed: What|Removed |Added BugsThisDependsOn||33099 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33381
[Bug target/33381] [4.2 regression] miscompilation casting signed long to void*
--- Comment #1 from mmitchel at gcc dot gnu dot org 2007-09-11 03:32 --- Ian -- Is this a VRP issue? Thanks, -- Mark -- mmitchel at gcc dot gnu dot org changed: What|Removed |Added CC||ian at airs dot com Priority|P3 |P1 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33381