Bug 41365 - [4.5 Regression] gcc.dg/vect/vect-cond-[123].c abort due to bad code generation at -O1 and above
Summary: [4.5 Regression] gcc.dg/vect/vect-cond-[123].c abort due to bad code generati...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.5.0
: P2 normal
Target Milestone: 4.5.0
Assignee: Steve Ellcey
URL:
Keywords: wrong-code
Depends on:
Blocks:
 
Reported: 2009-09-15 23:38 UTC by Steve Ellcey
Modified: 2009-09-29 22:36 UTC (History)
3 users (show)

See Also:
Host: ia64-*-*
Target: ia64-*-*
Build: ia64-*-*
Known to work:
Known to fail:
Last reconfirmed: 2009-09-22 23:13:08


Attachments
test case that aborts when compiled with -O1 or -O2 (415 bytes, text/plain)
2009-09-15 23:40 UTC, Steve Ellcey
Details
A patch that fixes the immediate problem (243 bytes, patch)
2009-09-17 14:24 UTC, Bernd Schmidt
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Steve Ellcey 2009-09-15 23:38:33 UTC
The gcc.dg/vect/vect-cond-[123].c tests started failing on IA64 Linux and HP-UX starting with version 5150588, Bernd Schmidt's auto-increment changes.  The tests in question don't actually get vectorized and the bug can be reproduced using just -O1 or -O2 optimization.  (-mlp64 is also needed on HP-UX)  I will attach a slightly cutdown version of vect-cond-1.c that will abort when compiled with -O1 or -O2 but not with -O0.
Comment 1 Steve Ellcey 2009-09-15 23:40:02 UTC
Created attachment 18591 [details]
test case that aborts when compiled with -O1 or -O2
Comment 2 Bernd Schmidt 2009-09-17 14:24:30 UTC
Created attachment 18601 [details]
A patch that fixes the immediate problem

This is a bug in the ia64 backend, which puts autoinc addressing modes into COND_EXECs, failing to notice that they have side effects.

This part of the problem can be fixed with the patch I'm attaching, but it doesn't work: the rest of the ia64 backend expects that this kind of insn can always be split.

At this point I'm leaving it for an ia64 maintainer to fix.
Comment 3 Steve Ellcey 2009-09-29 22:21:39 UTC
Subject: Bug 41365

Author: sje
Date: Tue Sep 29 22:21:27 2009
New Revision: 152306

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=152306
Log:
2009-09-29  Steve Ellcey  <sje@cup.hp.com>
	    Alexander Monakov  <amonakov@ispras.ru>

	PR target/41365 
	* config/ia64/predicates.md (not_postinc_destination_operand): New.
	(not_postinc_memory_operand): New.
	(not_postinc_move_operand): New.
	* config/ia64/ia64.md (*cmovdi_internal): Disallow autoincrement.
	(*cmovsi_internal): Ditto.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/ia64/ia64.md
    trunk/gcc/config/ia64/predicates.md

Comment 4 Steve Ellcey 2009-09-29 22:36:32 UTC
Fixed.