Bug 28964 - [4.0/4.1 Regression] partition_stack_vars uses unstable sort
Summary: [4.0/4.1 Regression] partition_stack_vars uses unstable sort
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: middle-end (show other bugs)
Version: 4.1.1
: P2 normal
Target Milestone: 4.2.0
Assignee: Richard Biener
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-09-06 16:02 UTC by Jorn Wolfgang Rennecke
Modified: 2006-09-25 12:04 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail: 4.1.2 4.2.0
Last reconfirmed: 2006-09-22 10:09:10


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jorn Wolfgang Rennecke 2006-09-06 16:02:36 UTC
position_stack_vars sorts stack_vars_sorted in a manner that makes the order
of stack vars with equal size undefined, thus making the compiler output
host dependent.
Comment 1 Andrew Pinski 2006-09-13 06:21:02 UTC
Confirmed, this is a regression as partition_stack_vars is new in 4.0.x.
I am thinking about either creating a meta-bug or a keyword about all the problems with unstable sorts/hashing with memory addresses problems.
Comment 2 Mark Mitchell 2006-09-20 22:32:21 UTC
A meta-bug would be helpful.

I've marked this P2, since this bug doesn't actually result in a user-observable problem on a single host -- but it is extremely desirable from the point of view of us, as GCC developers, and from the point of view of many users, that all hosts generate the same code.  So, it would be very good to get this defect fixed.
Comment 3 Richard Biener 2006-09-22 10:09:10 UTC
I have a patch.
Comment 4 patchapp@dberlin.org 2006-09-22 11:25:24 UTC
Subject: Bug number PR28964

A patch for this bug has been added to the patch tracker.
The mailing list url for the patch is http://gcc.gnu.org/ml/gcc-patches/2006-09/msg00976.html
Comment 5 Richard Biener 2006-09-22 15:43:36 UTC
Subject: Bug 28964

Author: rguenth
Date: Fri Sep 22 15:43:27 2006
New Revision: 117146

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=117146
Log:
2006-09-22  Richard Guenther  <rguenther@suse.de>

	PR middle-end/28964
	* cfgexpand.c (stack_var_size_cmp): Use DECL_UID to make
	sort of stack variables stable.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/cfgexpand.c

Comment 6 Richard Biener 2006-09-22 15:43:43 UTC
Fixed on the mainline.
Comment 7 Richard Biener 2006-09-25 12:04:38 UTC
WONTFIX on 4.0/4.1 branches.