Files
archived-llvm/test/CodeGen/X86
Robin Morisset 28127ffb51 [X86] Fix a bug with fetch_add(INT32_MIN)
Summary:
Fix pr21099

The pseudocode of what we were doing (spread through two functions) was:
if (operand.doesNotFitIn32Bits())
  Opc.initializeWithFoo();
if (operand < 0)
  operand = -operand;
if (operand.doesFitIn8Bits())
  Opc.initializeWithBar();
else if (operand.doesFitIn32Bits())
  Opc.initializeWithBlah();
doStuff(Opc);

So for operand == INT32_MIN, Opc was never initialized because the operand changes
from fitting in 32 bits to not fitting, causing the various bugs/error messages
noted by pr21099.

This patch adds an extra test at the beginning for this case, and an
llvm_unreachable to have better error message if the operand ends up
not fitting in 32-bits at the end.

Test Plan: new test + make check

Reviewers: jfb

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D5655

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219257 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-07 23:53:57 +00:00
..
2014-06-09 22:42:55 +00:00
2012-07-16 19:35:43 +00:00
2014-02-16 07:31:05 +00:00
2012-05-19 23:34:59 +00:00
2013-10-15 23:33:07 +00:00
2013-10-15 23:33:07 +00:00
2013-09-16 22:22:07 +00:00
2012-10-25 17:50:05 +00:00
2013-03-06 00:17:04 +00:00
2013-03-06 00:17:04 +00:00
2013-08-27 08:39:25 +00:00
2013-10-15 23:33:07 +00:00
2014-01-16 06:31:20 +00:00
2014-04-19 13:47:43 +00:00
2013-10-15 23:33:07 +00:00
2014-05-05 16:47:07 +00:00
2013-10-15 23:33:07 +00:00
2014-09-19 01:14:56 +00:00
2014-06-27 18:19:56 +00:00
2013-10-15 23:33:07 +00:00
2014-06-27 18:19:56 +00:00
2014-06-27 18:19:56 +00:00
2013-10-15 23:33:07 +00:00
2013-10-15 23:33:07 +00:00
2013-10-15 23:33:07 +00:00
2012-05-24 22:08:29 +00:00
2013-10-15 23:33:07 +00:00
2013-10-15 23:33:07 +00:00
2013-10-15 23:33:07 +00:00
2013-10-15 23:33:07 +00:00
2013-10-15 23:33:07 +00:00
2013-10-15 23:33:07 +00:00
2013-08-21 17:14:31 +00:00
2013-10-16 02:27:33 +00:00
2013-12-11 08:38:42 +00:00
2013-12-11 08:38:42 +00:00
2013-10-15 23:33:07 +00:00
2014-01-24 17:20:08 +00:00
2013-10-15 23:33:07 +00:00
2014-06-27 18:19:56 +00:00
2013-10-15 23:33:07 +00:00
2014-05-06 01:20:42 +00:00
2013-11-14 06:05:49 +00:00
2014-03-21 00:30:24 +00:00
2013-12-11 04:10:41 +00:00
2014-02-25 20:01:08 +00:00
2013-10-15 23:33:07 +00:00
2013-03-01 18:40:30 +00:00
2013-02-25 23:01:03 +00:00
2012-09-12 21:43:09 +00:00
2013-03-01 19:23:37 +00:00
2012-09-17 18:05:20 +00:00
2012-10-01 16:44:04 +00:00
2013-10-15 23:33:07 +00:00
2012-10-29 17:57:12 +00:00
2013-02-12 16:07:27 +00:00
2013-03-20 02:33:21 +00:00
2013-03-14 06:57:42 +00:00
2013-10-15 17:51:02 +00:00
2013-10-15 17:51:58 +00:00
2013-12-03 09:17:32 +00:00
2013-11-02 00:10:02 +00:00
2013-11-22 17:56:57 +00:00
2013-11-25 18:05:22 +00:00
2013-11-26 20:31:31 +00:00
2013-10-15 23:33:07 +00:00
2012-09-26 08:24:51 +00:00
2013-10-15 23:33:07 +00:00
2013-10-15 23:33:07 +00:00
2013-10-31 17:50:45 +00:00
2012-09-26 08:24:51 +00:00
2012-11-08 07:28:54 +00:00
2012-04-20 23:36:09 +00:00
2013-09-23 16:57:52 +00:00
2013-10-15 23:33:07 +00:00
2014-01-24 17:20:08 +00:00
2013-10-15 23:33:07 +00:00
2013-02-19 17:11:48 +00:00
2013-10-15 23:33:07 +00:00
2014-05-20 17:40:03 +00:00
2013-10-15 23:33:07 +00:00
2012-06-01 05:00:54 +00:00
2013-10-15 23:33:07 +00:00
2013-11-17 10:53:19 +00:00
2013-10-15 23:33:07 +00:00
2012-03-30 00:26:54 +00:00
2013-03-15 00:10:23 +00:00
2014-07-16 15:37:08 +00:00
2014-01-11 21:06:00 +00:00
2014-02-28 18:44:39 +00:00
2014-06-07 21:23:09 +00:00
2013-10-15 23:33:07 +00:00
2013-12-05 05:44:44 +00:00
2013-03-26 22:47:01 +00:00
2013-10-15 23:33:07 +00:00
2013-10-15 23:33:07 +00:00