Skip to content
Snippets Groups Projects
  • Andrew Pinski's avatar
    bd0c9d9e
    Fix PRs 106764, 106765, and 107307, all ICE after invalid re-declaration · bd0c9d9e
    Andrew Pinski authored
    The problem here is the gimplifier returns GS_ERROR but
    in some cases we don't check that soon enough and try
    to do other work which could crash.
    So the fix in these two cases is to return GS_ERROR
    early if the gimplify_* functions had return GS_ERROR.
    
    OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions.
    
    Thanks,
    Andrew Pinski
    
    gcc/ChangeLog:
    
    	PR c/106764
    	PR c/106765
    	PR c/107307
    	* gimplify.cc (gimplify_compound_lval): Return GS_ERROR
    	if gimplify_expr had return GS_ERROR.
    	(gimplify_call_expr): Likewise.
    
    gcc/testsuite/ChangeLog:
    
    	PR c/106764
    	PR c/106765
    	PR c/107307
    	* gcc.dg/redecl-19.c: New test.
    	* gcc.dg/redecl-20.c: New test.
    	* gcc.dg/redecl-21.c: New test.
    bd0c9d9e
    History
    Fix PRs 106764, 106765, and 107307, all ICE after invalid re-declaration
    Andrew Pinski authored
    The problem here is the gimplifier returns GS_ERROR but
    in some cases we don't check that soon enough and try
    to do other work which could crash.
    So the fix in these two cases is to return GS_ERROR
    early if the gimplify_* functions had return GS_ERROR.
    
    OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions.
    
    Thanks,
    Andrew Pinski
    
    gcc/ChangeLog:
    
    	PR c/106764
    	PR c/106765
    	PR c/107307
    	* gimplify.cc (gimplify_compound_lval): Return GS_ERROR
    	if gimplify_expr had return GS_ERROR.
    	(gimplify_call_expr): Likewise.
    
    gcc/testsuite/ChangeLog:
    
    	PR c/106764
    	PR c/106765
    	PR c/107307
    	* gcc.dg/redecl-19.c: New test.
    	* gcc.dg/redecl-20.c: New test.
    	* gcc.dg/redecl-21.c: New test.