Skip to content
Snippets Groups Projects
  • Richard Biener's avatar
    b0856bb5
    middle-end/110055 - avoid CLOBBERing static variables · b0856bb5
    Richard Biener authored
    The gimplifier can elide initialized constant automatic variables
    to static storage in which case TARGET_EXPR gimplification needs
    to avoid emitting a CLOBBER for them since their lifetime is no
    longer limited.  Failing to do so causes spurious dangling-pointer
    diagnostics on the added testcase for some targets.
    
    	PR middle-end/110055
    	* gimplify.cc (gimplify_target_expr): Do not emit
    	CLOBBERs for variables which have static storage duration
    	after gimplifying their initializers.
    
    	* g++.dg/warn/Wdangling-pointer-pr110055.C: New testcase.
    
    (cherry picked from commit 84eec291)
    b0856bb5
    History
    middle-end/110055 - avoid CLOBBERing static variables
    Richard Biener authored
    The gimplifier can elide initialized constant automatic variables
    to static storage in which case TARGET_EXPR gimplification needs
    to avoid emitting a CLOBBER for them since their lifetime is no
    longer limited.  Failing to do so causes spurious dangling-pointer
    diagnostics on the added testcase for some targets.
    
    	PR middle-end/110055
    	* gimplify.cc (gimplify_target_expr): Do not emit
    	CLOBBERs for variables which have static storage duration
    	after gimplifying their initializers.
    
    	* g++.dg/warn/Wdangling-pointer-pr110055.C: New testcase.
    
    (cherry picked from commit 84eec291)