Summary: | [4.3 regression] Bootstrap comparison failure | ||
---|---|---|---|
Product: | gcc | Reporter: | andreasmeier80 |
Component: | tree-optimization | Assignee: | Not yet assigned to anyone <unassigned> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | anhvofrcaus, ebotcazou, gcc-bugs, rguenther, rth, schwab, sje |
Priority: | P1 | ||
Version: | 4.3.0 | ||
Target Milestone: | 4.3.0 | ||
See Also: | https://gcc.gnu.org/bugzilla/show_bug.cgi?id=33065 | ||
Host: | Target: | i686-pc-linux-gnu,ia64-*-* | |
Build: | Known to work: | ||
Known to fail: | Last reconfirmed: | 2007-07-31 13:32:01 | |
Attachments: | untested patch |
Description
andreasmeier80
2007-07-31 08:46:16 UTC
The difference is created during the tree-eh pass, when try/finally is lowered. The problem is that the goto queue is sorted by address and the cont_stmt of the first queue element is used for the final branch out. This makes the used goto expr dependent on tree addresses. *** Bug 32983 has been marked as a duplicate of this bug. *** Created attachment 14047 [details]
untested patch
I can't reliably reproduce the problem but the attached patch may fix it. It removes the sort and replaces bsearch with a simple linear search. While bootstrapping the largest size I saw for the queue was 7. While compiling larger C++ tests (SPEC2006) I saw it reach 30, but that is the largest I saw. For 30 elements or less (99% of the time it is a single element) I think a linear search is reasonable. Can someone who can reliably reproduce the problem test this patch?
The regression was caused by the following patch New Revision: 126951 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=126951 Log: 2007-07-26 Richard Guenther <rguenther@suse.de> toplev/ * configure.ac: Add types checking to stage1 checking flags. * configure: Regenerate. gcc/ * tree-cfg.c (verify_gimple_unary_expr, verify_gimple_binary_expr, verify_gimple_min_lval, verify_gimple_reference, verify_gimple_expr, verify_gimple_modify_stmt, verify_gimple_stmt, verify_gimple_1, verify_gimple): New functions. * tree-flow.h (verify_gimple): Declare. (verify_gimple_1): Declare. * gimplify.c (cpt_same_type): Remove. (gimplify_addr_expr): Remove checking code. (check_pointer_types_r): Remove. (gimplify_body): Call verify_gimple_1 instead of check_pointer_types_r. Only verify if there were no errors. * configure.ac: Add types checking flag. * configure: Regenerate. * config.in: Regenerate. Modified: trunk/ChangeLog trunk/configure trunk/configure.ac trunk/gcc/config.in trunk/gcc/configure trunk/gcc/configure.ac trunk/gcc/gimplify.c trunk/gcc/tree-cfg.c trunk/gcc/tree-flow.h I'm now testing the patch from Comment #7. The patch works fine for me. Looks good. Subject: Bug 32941 Author: sje Date: Tue Aug 14 18:12:34 2007 New Revision: 127487 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=127487 Log: PR tree-optimization/32941 * tree-eh.c (struct leh_tf_state): Add goto_queue_map field. (goto_queue_cmp): Remove. (find_goto_replacement): Change search method. (maybe_record_in_goto_queue): Add assert. (lower_try_finally): Remove qsort call, add pointer_map_destroy call. * Makefile.in (tree-eh.o): Add pointer-set.h dependency. Modified: trunk/gcc/ChangeLog trunk/gcc/Makefile.in trunk/gcc/tree-eh.c Fixed |