Summary: | [3.4 Regression] powerpc-eabispe produces bad sCOND operation | ||
---|---|---|---|
Product: | gcc | Reporter: | Dara Hazeghi <dhazeghi> |
Component: | target | Assignee: | Aldy Hernandez <aldyh> |
Status: | RESOLVED FIXED | ||
Severity: | critical | CC: | gcc-bugs |
Priority: | P1 | Keywords: | ice-checking, wrong-code |
Version: | 3.4.0 | ||
Target Milestone: | 3.4.1 | ||
Host: | Target: | powerpc-eabispe | |
Build: | Known to work: | 4.0.0 | |
Known to fail: | 3.4.0 | Last reconfirmed: | 2003-11-29 21:36:53 |
Attachments: |
unreduced testcase
Reduced testcase |
Description
Dara Hazeghi
2003-08-21 23:32:44 UTC
Created attachment 4638 [details]
unreduced testcase
fails with cross cc1 to powerpc-easbispe with -O2 or higher optimization.
I think this is a regression from 3.3. Created attachment 4774 [details]
Reduced testcase
Since Zdenek reduced this, I am marking as confirmed. The regression in PR 12028 was introduced or exposed by this patch: --- gcc/gcc/ChangeLog --- 2003-05-03 Geoffrey Keating <geoffk@apple.com> * config/rs6000/rs6000.c (scc_comparison_operator): Make equivalent to branch_positive_comparison_operator. (ccr_bit): Check that sCOND conditions are actually a positive bit. (print_operand): Remove %D substitution. (rs6000_emit_sCOND): Generate complement operation to ensure that sCOND input is a positive bit. * config/rs6000/rs6000.md: Rearrange sCOND templates to be in the same order as bCOND, and add the missing ones. Remove the %D substitutions from the scc patterns. * simplify-rtx.c (simplify_relational_operation): Add case for ! (fabs(x) < 0.0). (http://gcc.gnu.org/ml/gcc-patches/2003-05/msg00338.html) The regression hunt took place on i686-pc-linux-gnu with a cross compiler for powerpc-eabispe, using the reduced test case from comment #3 with -O2. The problem is part of the patch: /* When generating a sCOND operation, only positive conditions are allowed. */ if (scc_p && code != EQ && code != GT && code != LT && code != UNORDERED && code != GTU && code != LTU) abort (); Down below that, there is case for NE (which is the code at this point). Subject: Re: [3.4 Regression] powerpc-eabispe: ICE building __divdi3.o: in ccr_bit, at config/rs6000/rs6000.c:8136 "pinskia at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org> writes: > ------- Additional Comments From pinskia at gcc dot gnu dot org 2003-11-09 21:41 ------- > The problem is part of the patch: > /* When generating a sCOND operation, only positive conditions are > allowed. */ > if (scc_p && code != EQ && code != GT && code != LT && code != UNORDERED > && code != GTU && code != LTU) > abort (); > Down below that, there is case for NE (which is the code at this point). The check is clearly correct. In the SPE case, both 'EQ' and 'NE' are 'base_bit + 1', but for a sCOND operation the bit must be set when the condition is true, and EQ and NE are mutually exclusive. So the problem must be somewhere else, and removing the check would only guarantee bad code generation. This was caused by your patch are you going to fix it? Subject: Bug 12028 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-3_4-branch Changes by: geoffk@gcc.gnu.org 2004-02-10 03:45:04 Modified files: gcc : ChangeLog gcc/config/rs6000: rs6000.c Log message: PR 12028 * config/rs6000/rs6000.c (ccr_bit): Don't let consistency check failure stop compilation, just print helpful message. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=2.2326.2.170&r2=2.2326.2.171 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/rs6000/rs6000.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.576.2.6&r2=1.576.2.7 The previous patch suppresses the build failure on the 3.4 branch. However, the underlying problem is still there. I believe it has been there since the e500 port was added. Should be fixed in 3.5.0 by Aldy's rewrite. Fixed on 3.4 branch by http://gcc.gnu.org/ml/gcc-patches/2004-04/msg01926.html |