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

Collapse All | Expand All

(-)a/gcc/testsuite/gcc.dg/special/wkali-3.c (+17 lines)
Line 0 Link Here
1
/* { dg-do run } */
2
/* { dg-require-weak "" } */
3
/* { dg-require-alias "" } */
4
/* { dg-additional-sources "wkali-3a.c" } */
5
6
#include <stdlib.h>
7
8
static const int dummy = 0;
9
extern const int foo __attribute__((__weak__, __alias__("dummy")));
10
11
int main(void) {
12
13
    if (foo)
14
        exit(0);
15
    else
16
        abort();
17
}
(-)a/gcc/testsuite/gcc.dg/special/wkali-3a.c (+3 lines)
Line 0 Link Here
1
/* { dg-do run } */
2
3
int foo = 1;
(-)a/gcc/varpool.c (-5 / +7 lines)
Lines 329-339 varpool_ctor_useable_for_folding_p (varpool_node *node) Link Here
329
  if (!TREE_READONLY (node->decl) && !TREE_READONLY (real_node->decl))
329
  if (!TREE_READONLY (node->decl) && !TREE_READONLY (real_node->decl))
330
    return false;
330
    return false;
331
331
332
  /* Variables declared 'const' without an initializer
332
  /* Accept variables declared 'const' without an initializer (so they have
333
     have zero as the initializer if they may not be
333
     zero as the initializer), unless they may be overridden at link time.  */
334
     overridden at link or run time.  */
334
  if (!DECL_INITIAL (real_node->decl) && DECL_EXTERNAL (node->decl))
335
  if (!DECL_INITIAL (real_node->decl)
335
    return false;
336
      && (DECL_EXTERNAL (node->decl) || decl_replaceable_p (node->decl)))
336
337
  /* Reject initializers that can be overridden at link or run time.  */
338
  if (decl_replaceable_p (node->decl))
337
    return false;
339
    return false;
338
340
339
  /* Variables declared `const' with an initializer are considered
341
  /* Variables declared `const' with an initializer are considered

Return to bug 61144