<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - weak symbol should be ignored for optimisation like early CSE ."
   href="https://bugs.llvm.org/show_bug.cgi?id=45733">45733</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>weak symbol should be ignored for optimisation like early CSE .
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>new-bugs
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Windows NT
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>new bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>umesh.kalappa0@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>htmldeveloper@gmail.com, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=23420" name="attach_23420" title="patch file .">attachment 23420</a> <a href="attachment.cgi?id=23420&action=edit" title="patch file .">[details]</a></span>
patch file .

The following C case 

$cat weak.c

#pragma weak x

const int x = 5;

int f ()

{ return x; }

$ clang -O2 -S weak.c

$ cat weak.s 
.text
        .file   "weak.c"
        .globl  f                       # -- Begin function f
        .p2align        4, 0x90
        .type   f,@function
f:                                      # @f
        .cfi_startproc
# %bb.0:
        pushq   %rbp
        .cfi_def_cfa_offset 16
        .cfi_offset %rbp, -16
        movq    %rsp, %rbp
        .cfi_def_cfa_register %rbp
        movl    $5, %eax      
        popq    %rbp
        .cfi_def_cfa %rsp, 8
        retq


the variable "x" can be override by other object /compilation unit ,so
propagating the constant in the function "f" is not right .

attached the patched file (weak.patch), fixes the issue .

so we raise a code review after testing .</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>