Bug 57349 - [4.9 Regression] ICE on 253.perlbmk with pgo after r198096
Summary: [4.9 Regression] ICE on 253.perlbmk with pgo after r198096
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: tree-optimization (show other bugs)
Version: 4.9.0
: P3 normal
Target Milestone: 4.9.0
Assignee: Richard Biener
URL:
Keywords:
Depends on:
Blocks: 56982
  Show dependency treegraph
 
Reported: 2013-05-21 08:04 UTC by Igor Zamyatin
Modified: 2013-05-22 11:28 UTC (History)
1 user (show)

See Also:
Host:
Target: x86
Build:
Known to work:
Known to fail:
Last reconfirmed: 2013-05-21 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Igor Zamyatin 2013-05-21 08:04:28 UTC
Output:
gcc  -c -o perl.o   -DSPEC_CPU2000_LP64 -DSPEC_CPU2000_LINUX_I386 -DSPEC_CPU2000_NEED_BOOL -DSPEC_CPU2000_GLIBC22    -fprofile-use       -O3 -ffast-math -funroll-loops   perl.c
Error from fdo_make_pass2 'specmake  FDO=PASS2 build > fdo_make_pass2.out 2> fdo_make_pass2.err':
 
Unable to coalesce ssa_names 1 and 7 which are marked as MUST COALESCE.
argc_1(ab) and  argc_7(ab)
perl.c: In function 'perl_parse':
perl.c:630:1: internal compiler error: SSA corruption
 perl_parse(PerlInterpreter *sv_interp, void (*xsinit) (void), int argc, char **argv, char **env)
 ^
0x9c56dd fail_abnormal_edge_coalesce
        ../../gcc/tree-ssa-coalesce.c:898
0x9c56dd coalesce_partitions
        ../../gcc/tree-ssa-coalesce.c:1200
0x9c56dd coalesce_ssa_name()
        ../../gcc/tree-ssa-coalesce.c:1337
0x97eaff remove_ssa_form
        ../../gcc/tree-outof-ssa.c:900
0x97eaff rewrite_out_of_ssa(ssaexpand*)
        ../../gcc/tree-outof-ssa.c:1133
0x5fdeca gimple_expand_cfg
        ../../gcc/cfgexpand.c:4541
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.
specmake: *** [perl.o] Error 1

Issue seems related to http://gcc.gnu.org/ml/gcc/2013-05/msg00162.html. although I haven't managed to make reproducer so far
Comment 1 Richard Biener 2013-05-21 08:59:26 UTC
I will have a look.
Comment 2 Richard Biener 2013-05-21 13:55:18 UTC
Reduced testcase, fails with -O -fbranch-probabilities

struct __jmp_buf_tag   { };
typedef struct __jmp_buf_tag jmp_buf[1];
typedef struct cop COP;
typedef struct gv GV;
struct cop {
    GV * cop_filegv;
};
struct jmpenv {
    jmp_buf je_buf;
    int je_ret;
};
typedef struct jmpenv JMPENV;
extern char * PL_origfilename;
extern COP * volatile PL_curcop ;
static void open_script() {
    PL_curcop->cop_filegv = Perl_gv_fetchfile(PL_origfilename);
}
int perl_parse(char **argv) {
    char *scriptname = ((void *)0);
    char *validarg = "";
    JMPENV cur_env;
    int fdscript = -1;
    cur_env.je_ret = _setjmp (((cur_env.je_buf)));
    if (!scriptname)  scriptname = argv[0];
    open_script();
    validate_suid(validarg, scriptname,fdscript);
}
Comment 3 Richard Biener 2013-05-22 09:44:44 UTC
I have a patch.
Comment 4 Richard Biener 2013-05-22 11:28:35 UTC
Author: rguenth
Date: Wed May 22 11:16:32 2013
New Revision: 199193

URL: http://gcc.gnu.org/viewcvs?rev=199193&root=gcc&view=rev
Log:
2013-05-22  Richard Biener  <rguenther@suse.de>

	PR middle-end/57349
	* profile.c (branch_prob): Do not split blocks that are
	abnormally receiving from ECF_RETURNS_TWICE functions.

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