1. Apr 14, 2014
    • Saleem Abdulrasool's avatar
      MC: check machine magic when applying offset adjustments · 2c08051c
      Saleem Abdulrasool authored
      The values for the relocation type can (and do) overlap across various
      architectures.  When performing an adjustment of the emitted relocation in the
      final object file, check that the file magic matches the target for which the
      relocation type is valid (e.g. a I386 relocation is only applied to an X86
      object file, and an AMD64 relocation is only applied to an X86_64 object file).
      This was noticed while adding support for ARM WinCOFF object file emission.
      
      A test case for this is not really possible as the values for REL32 do not
      overlap on I386 and AMD64, which is why this was never noticed in practice.  The
      ARM WinCOFF emission is not yet ready to merge into the tree.
      
      llvm-svn: 206138
      2c08051c
    • Serge Pavlov's avatar
      Recognize test for overflow in integer multiplication. · 4bb54d51
      Serge Pavlov authored
      If multiplication involves zero-extended arguments and the result is
      compared as in the patterns:
      
          %mul32 = trunc i64 %mul64 to i32
          %zext = zext i32 %mul32 to i64
          %overflow = icmp ne i64 %mul64, %zext
      or
          %overflow = icmp ugt i64 %mul64 , 0xffffffff
      
      then the multiplication may be replaced by call to umul.with.overflow.
      This change fixes PR4917 and PR4918.
      
      Differential Revision: http://llvm-reviews.chandlerc.com/D2814
      
      llvm-svn: 206137
      4bb54d51
    • Hal Finkel's avatar
      [PowerPC] Fix rlwimi isel when mask is not constant · d9963c75
      Hal Finkel authored
      We had been using the known-zero values of the operand of the or to construct
      the mask for an rlwimi; this is not quite correct, but fine when the mask is
      constant. When the mask is constant, then the known zeros of the operand must
      be a superset of the zeros in the mask. However, when the mask is not a
      constant, then there might be bits in the operand that are not known to be zero
      that, at runtime, might be zero in the mask. Therefore, we check that any bits
      not known to be zero *are* known to be one in the mask. Otherwise, we can't
      fold the mask with the or and shift.
      
      This was revealed as a miscompile of
      MultiSource/Benchmarks/BitBench/drop3/drop3 when I started experimenting with
      constant hoisting.
      
      llvm-svn: 206136
      d9963c75
    • Serge Pavlov's avatar
      Improve error recovery around colon. · 6a7ffbed
      Serge Pavlov authored
      Parse of nested name spacifier is modified so that it properly recovers
      if colon is mistyped as double colon in case statement.
      This patch fixes PR15133.
      
      Differential Revision: http://llvm-reviews.chandlerc.com/D2870
      
      llvm-svn: 206135
      6a7ffbed
    • Tobias Grosser's avatar
      Update isl to fix memory bugs · 8e5e78e1
      Tobias Grosser authored
      llvm-svn: 206134
      8e5e78e1
    • Logan Chien's avatar
      Fix diagnostics for C-style cast to function type. · af24ad94
      Logan Chien authored
      If the C-style type cast is applied to the overloaded
      function and the destination type is function type,
      then Clang will crash with assertion failure.  For example,
      
          void foo(int);
          void foo(int, int);
          void bar() {
              typedef void (ft)(int);
              ft p = (ft)foo;
          }
      
      In this case, the overloaded function foo will be cast to
      a function type, which should be considered as an error.
      But, unfortunately, since the function resolution is using
      canonical type, the matched function will be returned, and
      result in SEGV.
      
      This patch fixes this issue by removing the assertion and
      add some error diagnostics as the one in static_cast.
      
      llvm-svn: 206133
      af24ad94
  2. Apr 13, 2014
  3. Apr 12, 2014