View | Details | Return to bug 61144 | Differences between
and this patch

Collapse All | Expand All

(-)varpool.c (-2 / +10 lines)
Lines 339-346 varpool_node::ctor_useable_for_folding_p Link Here
339
339
340
  /* Variables declared 'const' without an initializer
340
  /* Variables declared 'const' without an initializer
341
     have zero as the initializer if they may not be
341
     have zero as the initializer if they may not be
342
     overridden at link or run time.  */
342
     overridden at link or run time.
343
  if (!DECL_INITIAL (real_node->decl)
343
344
     It is actually requirement for C++ compiler to optimize const variables
345
     consistently. As a GNU extension, do not enfore this rule for user defined
346
     weak variables, so we support interposition on:
347
     static const int dummy = 0;
348
     extern const int foo __attribute__((__weak__, __alias__("dummy"))); 
349
   */
350
  if ((!DECL_INITIAL (real_node->decl)
351
       || (DECL_WEAK (decl) && !DECL_COMDAT (decl)))
344
      && (DECL_EXTERNAL (decl) || decl_replaceable_p (decl)))
352
      && (DECL_EXTERNAL (decl) || decl_replaceable_p (decl)))
345
    return false;
353
    return false;
346
354

Return to bug 61144