From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5276 invoked by alias); 21 Nov 2001 14:26:00 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 5246 invoked by uid 71); 21 Nov 2001 14:26:00 -0000 Resent-Date: 21 Nov 2001 14:26:00 -0000 Resent-Message-ID: <20011121142600.5245.qmail@sourceware.cygnus.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-To: nobody@gcc.gnu.org Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, ottoni@ic.unicamp.br Received:(qmail 3035 invoked by uid 61); 21 Nov 2001 14:20:18 -0000 Message-Id:<20011121142018.3034.qmail@sourceware.cygnus.com> Date: Fri, 16 Nov 2001 23:39:00 -0000 From: ottoni@ic.unicamp.br Reply-To: ottoni@ic.unicamp.br To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version:gnatsweb-2.9.2 (1.1.1.1.2.21) Subject: optimization/4919: gcse inhibits loop optimization X-SW-Source: 2001-11/txt/msg00430.txt.bz2 List-Id: >Number: 4919 >Category: optimization >Synopsis: gcse inhibits loop optimization >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: pessimizes-code >Submitter-Id: net >Arrival-Date: Wed Nov 21 06:26:00 PST 2001 >Closed-Date: >Last-Modified: >Originator: Guilherme Ottoni >Release: gcc version 3.1 20011029 (experimental) >Organization: >Environment: RedHat Linux 6.2 running on a PC (K6-II) >Description: Compiling with gcc -O2 the source attached, the loop optimizer fails to detect BIVs, and so misses the opportunity to apply all the loop optimizations. If you add the -no-gcse flag to the command line, the loop optimizer works properly. To check what the loop optimizer is doing, I'm looking at the debug file generated by -dL. >How-To-Repeat: Simply compile the source attached, with -O2, and with and without the -fno-gcse. Then look at the .loop debug files to check the problem. I'm using a dsp16xx target, but I think this problem will occur with any target, as it is before the backend. >Fix: Maybe enhancing the BIV detection method to get the BIVs in these cases. Another (dirty) solution would be to inhibit the GCSE to optimize the code in the LOOP_CONT. >Release-Note: >Audit-Trail: >Unformatted: ----gnatsweb-attachment---- Content-Type: application/octet-stream; name="cc2001.c" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="cc2001.c" bWFpbigpCnsKICBpbnQgIGksIGF2ZywgYVsxMDBdLCBlcnJvcjsKICBmb3IgKGk9MDsgaSA8IDkw OyBpKyspCiAgewogICAgaWYgKGklMikKICAgIHsgCiAgICAgIGF2ZyArPSBhW2krMV0gPDwgMjsK ICAgICAgYVtpKzJdID0gYXZnICogMzsKICAgIH0KICAgIGlmIChhdmcgPCBlcnJvcikKICAgICAg YXZnIC09IGFbaSsxXSAtIGVycm9yLzI7CiAgICBlbHNlCiAgICAgIGF2ZyAtPSBhW2krMl0gLSBl cnJvcjsKICB9Cn0KCg==