* [Bug middle-end/21085] [4.0/4.1 Regression] Virtual memory exhausted with g++
2005-04-18 13:16 [Bug c++/21085] New: Virtual memory exhausted with g++ strieder at informatik dot uni-kl dot de
@ 2005-04-18 19:18 ` pinskia at gcc dot gnu dot org
2005-04-18 19:18 ` pinskia at gcc dot gnu dot org
` (15 subsequent siblings)
16 siblings, 0 replies; 18+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-04-18 19:18 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
Known to fail| |4.0.0 4.1.0
Known to work| |3.4.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21085
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug middle-end/21085] [4.0/4.1 Regression] Virtual memory exhausted with g++
2005-04-18 13:16 [Bug c++/21085] New: Virtual memory exhausted with g++ strieder at informatik dot uni-kl dot de
2005-04-18 19:18 ` [Bug middle-end/21085] [4.0/4.1 Regression] " pinskia at gcc dot gnu dot org
@ 2005-04-18 19:18 ` pinskia at gcc dot gnu dot org
2005-04-18 19:24 ` pinskia at gcc dot gnu dot org
` (14 subsequent siblings)
16 siblings, 0 replies; 18+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-04-18 19:18 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-04-18 19:18 -------
On the mainline we don't get virtual memory exhausted but that is because there has been a patch or
two to fix the memory usage but instead we get stack overflow:
#1207 0x002fc6e0 in fold_binary (code=TRUNC_MOD_EXPR, type=0x41d0c780, op0=0x26c9600,
op1=0x26b95e0) at /Users/pinskia/src/alias/gcc/gcc/fold-const.c:8509
#1208 0x002fe288 in fold_build2 (code=TRUNC_MOD_EXPR, type=0x26c9600, op0=0x17, op1=0x7)
at /Users/pinskia/src/alias/gcc/gcc/fold-const.c:10253
#1209 0x002fc6e0 in fold_binary (code=TRUNC_MOD_EXPR, type=0x41d0c780, op0=0x26c9600,
op1=0x26b95c0) at /Users/pinskia/src/alias/gcc/gcc/fold-const.c:8509
#1210 0x002fe288 in fold_build2 (code=TRUNC_MOD_EXPR, type=0x26c9600, op0=0x17, op1=0x7)
at /Users/pinskia/src/alias/gcc/gcc/fold-const.c:10253
#1211 0x002fc6e0 in fold_binary (code=TRUNC_MOD_EXPR, type=0x41d0c780, op0=0x26c9600,
op1=0x26b95a0) at /Users/pinskia/src/alias/gcc/gcc/fold-const.c:8509
Let me try to get a reduced testcase.
--
What |Removed |Added
----------------------------------------------------------------------------
Component|c++ |middle-end
Keywords| |ice-on-valid-code
Summary|Virtual memory exhausted |[4.0/4.1 Regression] Virtual
|with g++ |memory exhausted with g++
Target Milestone|--- |4.0.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21085
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug middle-end/21085] [4.0/4.1 Regression] Virtual memory exhausted with g++
2005-04-18 13:16 [Bug c++/21085] New: Virtual memory exhausted with g++ strieder at informatik dot uni-kl dot de
2005-04-18 19:18 ` [Bug middle-end/21085] [4.0/4.1 Regression] " pinskia at gcc dot gnu dot org
2005-04-18 19:18 ` pinskia at gcc dot gnu dot org
@ 2005-04-18 19:24 ` pinskia at gcc dot gnu dot org
2005-04-18 19:25 ` pinskia at gcc dot gnu dot org
` (13 subsequent siblings)
16 siblings, 0 replies; 18+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-04-18 19:24 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-04-18 19:24 -------
Reduced testcase:
int main( int argc, char * argv[ ] )
{
int maxstringlen = 1;
int limit = 0, maxblock = 0, maxblockrem = 0;
maxblockrem = (maxstringlen) % (2147483647 + 1);
}
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Last reconfirmed|0000-00-00 00:00:00 |2005-04-18 19:24:03
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21085
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug middle-end/21085] [4.0/4.1 Regression] Virtual memory exhausted with g++
2005-04-18 13:16 [Bug c++/21085] New: Virtual memory exhausted with g++ strieder at informatik dot uni-kl dot de
` (2 preceding siblings ...)
2005-04-18 19:24 ` pinskia at gcc dot gnu dot org
@ 2005-04-18 19:25 ` pinskia at gcc dot gnu dot org
2005-04-18 19:38 ` pinskia at gcc dot gnu dot org
` (12 subsequent siblings)
16 siblings, 0 replies; 18+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-04-18 19:25 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-04-18 19:25 -------
(In reply to comment #2)
> Reduced testcase:
Even though there is an overflow which the C front-end says the code was in an if (0) block so it should
not matter about that as it is only undefined then but we still should not be crashing.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21085
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug middle-end/21085] [4.0/4.1 Regression] Virtual memory exhausted with g++
2005-04-18 13:16 [Bug c++/21085] New: Virtual memory exhausted with g++ strieder at informatik dot uni-kl dot de
` (3 preceding siblings ...)
2005-04-18 19:25 ` pinskia at gcc dot gnu dot org
@ 2005-04-18 19:38 ` pinskia at gcc dot gnu dot org
2005-04-18 20:15 ` phython at gcc dot gnu dot org
` (11 subsequent siblings)
16 siblings, 0 replies; 18+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-04-18 19:38 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-04-18 19:38 -------
Most likely caused by:
2004-07-05 Roger Sayle <roger@eyesopen.com>
* fold-const.c (fold) <TRUNC_MOD_EXPR>: Optimize unsigned modulus
by a power of two into a bit-wise AND, i.e. "X % C" as "X & (C-1)".
Normalize "X % C" as "X % -C" for signed modulus and negative C.
Optimize "X % -Y" as "X % Y" for signed modulus.
<EQ_EXPR>: Recursively call "fold" when transforming "(X % Y) == 0"
into "((unsigned) X % Y) == 0".
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |roger at eyesopen dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21085
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug middle-end/21085] [4.0/4.1 Regression] Virtual memory exhausted with g++
2005-04-18 13:16 [Bug c++/21085] New: Virtual memory exhausted with g++ strieder at informatik dot uni-kl dot de
` (4 preceding siblings ...)
2005-04-18 19:38 ` pinskia at gcc dot gnu dot org
@ 2005-04-18 20:15 ` phython at gcc dot gnu dot org
2005-04-18 20:47 ` roger at eyesopen dot com
` (10 subsequent siblings)
16 siblings, 0 replies; 18+ messages in thread
From: phython at gcc dot gnu dot org @ 2005-04-18 20:15 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From phython at gcc dot gnu dot org 2005-04-18 20:15 -------
Created an attachment (id=8678)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=8678&action=view)
Don't alter overflowed constants
sign_bit_p returns false for overflowed constants, this is bad for this
testcase.
--
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |phython at gcc dot gnu dot
|dot org |org
Status|NEW |ASSIGNED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21085
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug middle-end/21085] [4.0/4.1 Regression] Virtual memory exhausted with g++
2005-04-18 13:16 [Bug c++/21085] New: Virtual memory exhausted with g++ strieder at informatik dot uni-kl dot de
` (5 preceding siblings ...)
2005-04-18 20:15 ` phython at gcc dot gnu dot org
@ 2005-04-18 20:47 ` roger at eyesopen dot com
2005-04-18 22:02 ` ja2morri at csclub dot uwaterloo dot ca
` (9 subsequent siblings)
16 siblings, 0 replies; 18+ messages in thread
From: roger at eyesopen dot com @ 2005-04-18 20:47 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From roger at eyesopen dot com 2005-04-18 20:47 -------
Wow, that was fast. I'd just started bootstrap and regression test on an
*identical* patch, and pulled up the PR to assign it to myself. You win!
I'll preapprove yours, together with the testcase from the PR, if it passes
bootstrap and regression test without problems.
Thanks.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21085
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug middle-end/21085] [4.0/4.1 Regression] Virtual memory exhausted with g++
2005-04-18 13:16 [Bug c++/21085] New: Virtual memory exhausted with g++ strieder at informatik dot uni-kl dot de
` (6 preceding siblings ...)
2005-04-18 20:47 ` roger at eyesopen dot com
@ 2005-04-18 22:02 ` ja2morri at csclub dot uwaterloo dot ca
2005-04-19 2:36 ` cvs-commit at gcc dot gnu dot org
` (8 subsequent siblings)
16 siblings, 0 replies; 18+ messages in thread
From: ja2morri at csclub dot uwaterloo dot ca @ 2005-04-18 22:02 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From ja2morri at csclub dot uwaterloo dot ca 2005-04-18 22:02 -------
Subject: Re: [4.0/4.1 Regression] Virtual memory exhausted with g++
Ahh, I posted the patch before starting the regtesting. I only checked to
make sure it worked on the testcase. I'll commit this patch after bootstrap
and regtesting finishes successfully on ia64-linux.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21085
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug middle-end/21085] [4.0/4.1 Regression] Virtual memory exhausted with g++
2005-04-18 13:16 [Bug c++/21085] New: Virtual memory exhausted with g++ strieder at informatik dot uni-kl dot de
` (7 preceding siblings ...)
2005-04-18 22:02 ` ja2morri at csclub dot uwaterloo dot ca
@ 2005-04-19 2:36 ` cvs-commit at gcc dot gnu dot org
2005-04-19 2:43 ` [Bug middle-end/21085] [4.0 only " phython at gcc dot gnu dot org
` (7 subsequent siblings)
16 siblings, 0 replies; 18+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-04-19 2:36 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2005-04-19 02:36 -------
Subject: Bug 21085
CVSROOT: /cvs/gcc
Module name: gcc
Changes by: phython@gcc.gnu.org 2005-04-19 02:36:04
Modified files:
gcc : ChangeLog fold-const.c
gcc/testsuite : ChangeLog
Added files:
gcc/testsuite/gcc.dg: pr21085.c
Log message:
2005-04-18 James A. Morrison <phython@gcc.gnu.org>
PR tree-optimization/21085
* fold-const (fold_binary): Don't change X % -C to X % C if C has
overflowed.
Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.8355&r2=2.8356
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fold-const.c.diff?cvsroot=gcc&r1=1.563&r2=1.564
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.5368&r2=1.5369
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/pr21085.c.diff?cvsroot=gcc&r1=NONE&r2=1.1
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21085
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug middle-end/21085] [4.0 only Regression] Virtual memory exhausted with g++
2005-04-18 13:16 [Bug c++/21085] New: Virtual memory exhausted with g++ strieder at informatik dot uni-kl dot de
` (8 preceding siblings ...)
2005-04-19 2:36 ` cvs-commit at gcc dot gnu dot org
@ 2005-04-19 2:43 ` phython at gcc dot gnu dot org
2005-04-19 6:11 ` [Bug middle-end/21085] [4.0 " pinskia at gcc dot gnu dot org
` (6 subsequent siblings)
16 siblings, 0 replies; 18+ messages in thread
From: phython at gcc dot gnu dot org @ 2005-04-19 2:43 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From phython at gcc dot gnu dot org 2005-04-19 02:43 -------
Fixed in the previous commit.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
Summary|[4.0/4.1 Regression] Virtual|[4.0 only Regression]
|memory exhausted with g++ |Virtual memory exhausted
| |with g++
Target Milestone|4.0.0 |4.1.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21085
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug middle-end/21085] [4.0 Regression] Virtual memory exhausted with g++
2005-04-18 13:16 [Bug c++/21085] New: Virtual memory exhausted with g++ strieder at informatik dot uni-kl dot de
` (9 preceding siblings ...)
2005-04-19 2:43 ` [Bug middle-end/21085] [4.0 only " phython at gcc dot gnu dot org
@ 2005-04-19 6:11 ` pinskia at gcc dot gnu dot org
2005-04-20 3:31 ` pinskia at gcc dot gnu dot org
` (5 subsequent siblings)
16 siblings, 0 replies; 18+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-04-19 6:11 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-04-19 06:10 -------
This is still a bad bug which should be fixed for 4.0.1 at least.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |REOPENED
Resolution|FIXED |
Summary|[4.0 only Regression] |[4.0 Regression] Virtual
|Virtual memory exhausted |memory exhausted with g++
|with g++ |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21085
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug middle-end/21085] [4.0 Regression] Virtual memory exhausted with g++
2005-04-18 13:16 [Bug c++/21085] New: Virtual memory exhausted with g++ strieder at informatik dot uni-kl dot de
` (10 preceding siblings ...)
2005-04-19 6:11 ` [Bug middle-end/21085] [4.0 " pinskia at gcc dot gnu dot org
@ 2005-04-20 3:31 ` pinskia at gcc dot gnu dot org
2005-04-20 4:32 ` phython at gcc dot gnu dot org
` (4 subsequent siblings)
16 siblings, 0 replies; 18+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-04-20 3:31 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
Status|REOPENED |ASSIGNED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21085
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug middle-end/21085] [4.0 Regression] Virtual memory exhausted with g++
2005-04-18 13:16 [Bug c++/21085] New: Virtual memory exhausted with g++ strieder at informatik dot uni-kl dot de
` (11 preceding siblings ...)
2005-04-20 3:31 ` pinskia at gcc dot gnu dot org
@ 2005-04-20 4:32 ` phython at gcc dot gnu dot org
2005-04-20 13:52 ` pinskia at gcc dot gnu dot org
` (3 subsequent siblings)
16 siblings, 0 replies; 18+ messages in thread
From: phython at gcc dot gnu dot org @ 2005-04-20 4:32 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|phython at gcc dot gnu dot |unassigned at gcc dot gnu
|org |dot org
Status|ASSIGNED |NEW
Known to fail|4.0.0 4.1.0 |4.0.0
Known to work|3.4.0 |3.4.0 4.1.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21085
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug middle-end/21085] [4.0 Regression] Virtual memory exhausted with g++
2005-04-18 13:16 [Bug c++/21085] New: Virtual memory exhausted with g++ strieder at informatik dot uni-kl dot de
` (12 preceding siblings ...)
2005-04-20 4:32 ` phython at gcc dot gnu dot org
@ 2005-04-20 13:52 ` pinskia at gcc dot gnu dot org
2005-05-11 12:46 ` cvs-commit at gcc dot gnu dot org
` (2 subsequent siblings)
16 siblings, 0 replies; 18+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-04-20 13:52 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-04-20 13:52 -------
I will take this and will try to get it approved for 4.0.1.
--
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |pinskia at gcc dot gnu dot
|dot org |org
Status|NEW |ASSIGNED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21085
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug middle-end/21085] [4.0 Regression] Virtual memory exhausted with g++
2005-04-18 13:16 [Bug c++/21085] New: Virtual memory exhausted with g++ strieder at informatik dot uni-kl dot de
` (13 preceding siblings ...)
2005-04-20 13:52 ` pinskia at gcc dot gnu dot org
@ 2005-05-11 12:46 ` cvs-commit at gcc dot gnu dot org
2005-05-11 12:50 ` pinskia at gcc dot gnu dot org
2005-05-11 12:50 ` cvs-commit at gcc dot gnu dot org
16 siblings, 0 replies; 18+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-05-11 12:46 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2005-05-11 12:46 -------
Subject: Bug 21085
CVSROOT: /cvs/gcc
Module name: gcc
Branch: gcc-4_0-branch
Changes by: pinskia@gcc.gnu.org 2005-05-11 12:46:09
Modified files:
gcc : ChangeLog fold-const.c tree-ssa-dse.c
Log message:
2005-05-11 James A. Morrison <phython@gcc.gnu.org>
PR tree-optimization/21085
* fold-const (fold): Don't change X % -C to X % C if C has
overflowed.
Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=2.7592.2.240&r2=2.7592.2.241
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fold-const.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.517.2.7&r2=1.517.2.8
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/tree-ssa-dse.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=2.17&r2=2.17.4.1
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21085
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug middle-end/21085] [4.0 Regression] Virtual memory exhausted with g++
2005-04-18 13:16 [Bug c++/21085] New: Virtual memory exhausted with g++ strieder at informatik dot uni-kl dot de
` (14 preceding siblings ...)
2005-05-11 12:46 ` cvs-commit at gcc dot gnu dot org
@ 2005-05-11 12:50 ` pinskia at gcc dot gnu dot org
2005-05-11 12:50 ` cvs-commit at gcc dot gnu dot org
16 siblings, 0 replies; 18+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-05-11 12:50 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-05-11 12:49 -------
Fixed also for 4.0.1.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
Target Milestone|4.1.0 |4.0.1
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21085
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug middle-end/21085] [4.0 Regression] Virtual memory exhausted with g++
2005-04-18 13:16 [Bug c++/21085] New: Virtual memory exhausted with g++ strieder at informatik dot uni-kl dot de
` (15 preceding siblings ...)
2005-05-11 12:50 ` pinskia at gcc dot gnu dot org
@ 2005-05-11 12:50 ` cvs-commit at gcc dot gnu dot org
16 siblings, 0 replies; 18+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-05-11 12:50 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2005-05-11 12:50 -------
Subject: Bug 21085
CVSROOT: /cvs/gcc
Module name: gcc
Branch: gcc-4_0-branch
Changes by: pinskia@gcc.gnu.org 2005-05-11 12:49:54
Modified files:
gcc/testsuite : ChangeLog
Added files:
gcc/testsuite/gcc.dg: pr21085.c
Log message:
2005-05-11 James A. Morrison <phython@gcc.gnu.org>
PR middle-end/21085
* gcc.dg/pr21085.c: New test.
Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.5084.2.172&r2=1.5084.2.173
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/pr21085.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=NONE&r2=1.1.6.1
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21085
^ permalink raw reply [flat|nested] 18+ messages in thread