[Bug target/20322] [4.0/4.1 Regression] Miscompilation of libcpp/expr.c at -O2+

2024-07-26 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=20322

--- Comment #7 from GCC Commits  ---
The master branch has been updated by Sam James :

https://gcc.gnu.org/g:a75c6295252d0d998a18927dc7510fac965134c4

commit r15-2349-ga75c6295252d0d998a18927dc7510fac965134c4
Author: Sam James 
Date:   Thu Jul 18 08:27:29 2024 +0100

testsuite: Add dg-do run to even more tests

All of these are for wrong-code bugs. Confirmed to be used before but
with no execution.

Tested on x86_64-pc-linux-gnu and checked test logs before/after.

2024-07-26  Sam James  

PR target/7559
PR c++/9704
PR c++/16115
PR c++/19317
PR rtl-optimization/11536
PR target/20322
PR tree-optimization/31966
PR rtl-optimization/41033
PR tree-optimization/67947
* g++.dg/cpp1z/byte1.C: Add dg-do run directive.
* g++.dg/init/call1.C: Ditto.
* g++.dg/init/copy5.C: Ditto.
* g++.dg/opt/nrv9.C: Ditto.
* gcc.dg/20021006-1.c: Ditto.
* gcc.dg/20030721-1.c: Ditto.
* gcc.dg/20050307-1.c: Ditto.
* gcc.dg/pr41033.c: Ditto.
* gcc.dg/torture/pr67947.c: Ditto.
* gcc.dg/tree-ssa/pr31966.c: Ditto.
* gcc.dg/tree-ssa/tailcall-3.c: Ditto.
* gcc.dg/tree-ssa/vrp74.c: Ditto.
* gcc.target/nvptx/abort.c: Fix whitespace in dg directive.

[Bug target/20322] [4.0/4.1 Regression] Miscompilation of libcpp/expr.c at -O2+

2005-03-11 Thread uros at kss-loka dot si

--- Additional Comments From uros at kss-loka dot si  2005-03-11 14:01 
---
Just FYI: arith-3.c still fails for me on pentium4. The sistem is fairly
unpatched Red Hat Linux release 8.0 (Psyche):

Linux moron 2.4.18-14 #1 Wed Sep 4 13:35:50 EDT 2002 i686 i686 i386 GNU/Linux

Compiler version: 4.1.0 20050310 (experimental) 
Platform: i686-pc-linux-gnu
libc-2.2.93.

Running target unix
FAIL: gcc.dg/cpp/arith-3.c  (test for bogus messages, line 257)
XPASS: gcc.dg/vect/vect-22.c scan-tree-dump-times vectorized 3 loops 1

However, testcase from description compiles and runs OK with "gcc -O2 
pr20322.c".


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20322


[Bug target/20322] [4.0/4.1 Regression] Miscompilation of libcpp/expr.c at -O2+

2005-03-10 Thread jakub at gcc dot gnu dot org

--- Additional Comments From jakub at gcc dot gnu dot org  2005-03-10 21:31 
---
Fixed in CVS.

-- 
   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20322


[Bug target/20322] [4.0/4.1 Regression] Miscompilation of libcpp/expr.c at -O2+

2005-03-10 Thread cvs-commit at gcc dot gnu dot org

--- Additional Comments From cvs-commit at gcc dot gnu dot org  2005-03-10 
21:30 ---
Subject: Bug 20322

CVSROOT:/cvs/gcc
Module name:gcc
Branch: gcc-4_0-branch
Changes by: [EMAIL PROTECTED]   2005-03-10 21:29:56

Modified files:
gcc: ChangeLog combine.c 
gcc/testsuite  : ChangeLog 
Added files:
gcc/testsuite/gcc.dg: 20050307-1.c 

Log message:
PR target/20322
* combine.c (try_combine): If recog_for_combine added CLOBBERs
to NEWI2PAT, fail to combine if they are used by NEWPAT.

* gcc.dg/20050307-1.c: New test.

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.39&r2=2.7592.2.40
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/combine.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.475&r2=1.475.4.1
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.33&r2=1.5084.2.34
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/20050307-1.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=NONE&r2=1.1.2.1



-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20322


[Bug target/20322] [4.0/4.1 Regression] Miscompilation of libcpp/expr.c at -O2+

2005-03-10 Thread cvs-commit at gcc dot gnu dot org

--- Additional Comments From cvs-commit at gcc dot gnu dot org  2005-03-10 
21:26 ---
Subject: Bug 20322

CVSROOT:/cvs/gcc
Module name:gcc
Changes by: [EMAIL PROTECTED]   2005-03-10 21:26:12

Modified files:
gcc: ChangeLog combine.c 
gcc/testsuite  : ChangeLog 
Added files:
gcc/testsuite/gcc.dg: 20050307-1.c 

Log message:
PR target/20322
* combine.c (try_combine): If recog_for_combine added CLOBBERs
to NEWI2PAT, fail to combine if they are used by NEWPAT.

* gcc.dg/20050307-1.c: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.7775&r2=2.7776
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/combine.c.diff?cvsroot=gcc&r1=1.478&r2=1.479
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.5138&r2=1.5139
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/20050307-1.c.diff?cvsroot=gcc&r1=NONE&r2=1.1



-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20322


[Bug target/20322] [4.0/4.1 Regression] Miscompilation of libcpp/expr.c at -O2+

2005-03-07 Thread jakub at gcc dot gnu dot org

--- Additional Comments From jakub at gcc dot gnu dot org  2005-03-07 16:06 
---
Patch here: 

-- 
   What|Removed |Added

 AssignedTo|unassigned at gcc dot gnu   |jakub at gcc dot gnu dot org
   |dot org |
 Status|UNCONFIRMED |ASSIGNED
 Ever Confirmed||1
   Keywords||patch
   Last reconfirmed|-00-00 00:00:00 |2005-03-07 16:06:06
   date||


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20322


[Bug target/20322] [4.0/4.1 Regression] Miscompilation of libcpp/expr.c at -O2+

2005-03-04 Thread jakub at gcc dot gnu dot org

--- Additional Comments From jakub at gcc dot gnu dot org  2005-03-04 18:30 
---
>From initial skimming, this sounds like combiner bug.
(insn 78 41 79 0 (set (reg:CC 17 flags)
(compare:CC (reg:DI 58 [ e$b.9 ])
(reg:DI 59 [ e$b.8 ]))) 2 {cmpdi_1_insn_rex64}
(insn_list:REG_DEP_TRUE 41 (nil))
(expr_list:REG_DEAD (reg:DI 59 [ e$b.8 ])
(nil)))

(insn 79 78 52 0 (parallel [
(set (reg:DI 64 [ e$a ])
(plus:DI (plus:DI (ltu:DI (reg:CC 17 flags)
(const_int 0 [0x0]))
(reg:DI 64 [ e$a ]))
(const_int 0 [0x0])))
(clobber (reg:CC 17 flags))
]) 174 {adddi3_carry_rex64} (insn_list:REG_DEP_TRUE 77
(insn_list:REG_DEP_TRUE 78 (nil)))
(expr_list:REG_DEAD (reg:CC 17 flags)
(expr_list:REG_UNUSED (reg:CC 17 flags)
(nil

(insn 52 79 53 0 (parallel [
(set (reg:DI 76)
(lshiftrt:DI (reg:DI 61 [ f$0 ])
(const_int 32 [0x20])))
(clobber (reg:CC 17 flags))
]) 435 {*lshrdi3_1_rex64} (nil)
(expr_list:REG_DEAD (reg:DI 61 [ f$0 ])
(expr_list:REG_UNUSED (reg:CC 17 flags)
(nil

(insn 53 52 55 0 (parallel [
(set (reg:DI 60 [ e$a.6 ])
(plus:DI (reg:DI 64 [ e$a ])
(reg:DI 76)))
(clobber (reg:CC 17 flags))
]) 192 {*adddi_1_rex64} (insn_list:REG_DEP_TRUE 79
(insn_list:REG_DEP_TRUE 52 (nil)))
(expr_list:REG_DEAD (reg:DI 64 [ e$a ])
(expr_list:REG_DEAD (reg:DI 76)
(expr_list:REG_UNUSED (reg:CC 17 flags)
(nil)

before combine is turned into:
(insn 78 41 79 0 (set (reg:CC 17 flags)
(compare:CC (reg:DI 58 [ e$b.9 ])
(reg:DI 59 [ e$b.8 ]))) 2 {cmpdi_1_insn_rex64}
(insn_list:REG_DEP_TRUE 41 (nil))
(expr_list:REG_DEAD (reg:DI 59 [ e$b.8 ])
(nil)))

(note 79 78 52 0 NOTE_INSN_DELETED)

(insn 52 79 53 0 (parallel [
(set (reg:DI 76)
(lshiftrt:DI (reg:DI 61 [ f$0 ])
(const_int 32 [0x20])))
(clobber (reg:CC 17 flags))
]) 435 {*lshrdi3_1_rex64} (nil)
(expr_list:REG_UNUSED (reg:CC 17 flags)
(expr_list:REG_DEAD (reg:DI 61 [ f$0 ])
(nil

(insn 53 52 55 0 (parallel [
(set (reg:DI 60 [ e$a.6 ])
(plus:DI (plus:DI (ltu:DI (reg:CC 17 flags)
(const_int 0 [0x0]))
(reg:DI 64 [ e$a ]))
(reg:DI 76)))
(clobber (reg:CC 17 flags))
]) 174 {adddi3_carry_rex64} (insn_list:REG_DEP_TRUE 77
(insn_list:REG_DEP_TRUE 52 (nil)))
(expr_list:REG_UNUSED (reg:CC 17 flags)
(expr_list:REG_DEAD (reg:DI 76)
(expr_list:REG_DEAD (reg:DI 64 [ e$a ])
(nil)

which shouldn't be done, because the middle instruction is kept and clobbers
(reg:CC 17 flags), so combiner can't move use of %eflags from the first to the
last insn accross the clobber.

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20322


[Bug target/20322] [4.0/4.1 Regression] Miscompilation of libcpp/expr.c at -O2+

2005-03-04 Thread pinskia at gcc dot gnu dot org


-- 
   What|Removed |Added

Summary|[4.0 Regression]|[4.0/4.1 Regression]
   |Miscompilation of   |Miscompilation of
   |libcpp/expr.c at -O2+   |libcpp/expr.c at -O2+


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20322