From 62c332ce9c9cf015eabb0a4aa0c83d4e96652820 Mon Sep 17 00:00:00 2001 From: Warren Block Date: Sun, 28 Jun 2015 20:53:36 +0000 Subject: Fix a couple of missing lines that obscured the -p description. Submitted by: Jonathan de Boyne Pollard MFC after: 1 week --- contrib/pf/pflogd/pflogd.8 | 2 ++ 1 file changed, 2 insertions(+) (limited to 'contrib') diff --git a/contrib/pf/pflogd/pflogd.8 b/contrib/pf/pflogd/pflogd.8 index 38c954c9ccfa5..d730a6b060e31 100644 --- a/contrib/pf/pflogd/pflogd.8 +++ b/contrib/pf/pflogd/pflogd.8 @@ -125,9 +125,11 @@ By default, .Nm will use .Ar pflog0 . +.It Fl p Ar pidfile Writes a file containing the process ID of the program to .Pa /var/run . The file name has the form +.Ao Ar pidfile Ac Ns .pid . The default is .Ar pflogd . .It Fl s Ar snaplen -- cgit v1.3 From 4ed220cdd7e05fde142b9bdc1ac373e3eb37f24f Mon Sep 17 00:00:00 2001 From: Ed Maste Date: Thu, 2 Jul 2015 14:44:30 +0000 Subject: Update meta2deps example after i386-elf to i386 rename --- contrib/bmake/mk/meta2deps.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'contrib') diff --git a/contrib/bmake/mk/meta2deps.sh b/contrib/bmake/mk/meta2deps.sh index 2a79be17a331e..0c934afd1c5fa 100755 --- a/contrib/bmake/mk/meta2deps.sh +++ b/contrib/bmake/mk/meta2deps.sh @@ -52,7 +52,7 @@ # $SB/obj-i386/bsd/gnu/lib/csu # $SB/obj-i386/bsd/gnu/lib/libgcc # $SB/obj-i386/bsd/include -# $SB/obj-i386/bsd/lib/csu/i386-elf +# $SB/obj-i386/bsd/lib/csu/i386 # $SB/obj-i386/bsd/lib/libc # $SB/src/bsd/include # $SB/src/bsd/sys/i386/include -- cgit v1.3 From c36e54bb328697af1e6113812caecbd3bac89fe0 Mon Sep 17 00:00:00 2001 From: Mariusz Zaborski Date: Thu, 2 Jul 2015 21:58:10 +0000 Subject: Let the nv.h and dnv.h includes be only in sys directory. Change consumers to include those files from sys. Add duplicated files to ObsoleteFiles. Approved by: pjd (mentor) --- ObsoleteFiles.inc | 3 +++ contrib/tcpdump/tcpdump.c | 2 +- lib/libcapsicum/libcapsicum.c | 2 +- lib/libcapsicum/libcapsicum_dns.c | 4 ++-- lib/libcapsicum/libcapsicum_grp.c | 5 ++--- lib/libcapsicum/libcapsicum_pwd.c | 3 +-- lib/libcapsicum/libcapsicum_random.c | 4 ++-- lib/libcapsicum/libcapsicum_service.c | 3 ++- lib/libcapsicum/libcapsicum_sysctl.c | 4 ++-- lib/libcasper/libcasper.c | 2 +- lib/libnv/Makefile | 3 --- lib/libnv/tests/dnv_tests.cc | 5 +++-- lib/libnv/tests/nv_tests.cc | 3 ++- lib/libnv/tests/nvlist_add_test.c | 4 ++-- lib/libnv/tests/nvlist_exists_test.c | 4 ++-- lib/libnv/tests/nvlist_free_test.c | 4 ++-- lib/libnv/tests/nvlist_get_test.c | 3 +-- lib/libnv/tests/nvlist_move_test.c | 4 ++-- lib/libnv/tests/nvlist_send_recv_test.c | 3 +-- libexec/casper/dns/dns.c | 2 +- libexec/casper/grp/grp.c | 3 ++- libexec/casper/pwd/pwd.c | 3 ++- libexec/casper/random/random.c | 3 ++- libexec/casper/sysctl/sysctl.c | 2 +- sbin/casperd/casperd.c | 2 +- sbin/casperd/zygote.c | 2 +- tools/regression/capsicum/libcapsicum/sysctl.c | 2 +- usr.bin/kdump/kdump.c | 6 +++--- usr.sbin/iovctl/iovctl.c | 4 ++-- usr.sbin/iovctl/parse.c | 2 +- usr.sbin/iovctl/validate.c | 4 ++-- 31 files changed, 51 insertions(+), 49 deletions(-) (limited to 'contrib') diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index 3e0c899408fe0..9cddbcea19933 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -38,6 +38,9 @@ # xargs -n1 | sort | uniq -d; # done +# 20150702: Remove duplicated nvlist includes. +OLD_FILES+=usr/include/dnv.h +OLD_FILES+=usr/include/nv.h # 20150528: PCI IOV device driver methods moved to a separate kobj interface. OLD_FILES+=usr/share/man/man9/PCI_ADD_VF.9.gz OLD_FILES+=usr/share/man/man9/PCI_INIT_IOV.9.gz diff --git a/contrib/tcpdump/tcpdump.c b/contrib/tcpdump/tcpdump.c index c8ca0bf5a4b37..aca877c5c3f9a 100644 --- a/contrib/tcpdump/tcpdump.c +++ b/contrib/tcpdump/tcpdump.c @@ -82,7 +82,7 @@ extern int SIZE_BUF; #include #include #include -#include +#include #include #include #include diff --git a/lib/libcapsicum/libcapsicum.c b/lib/libcapsicum/libcapsicum.c index 79c570f60e447..8c4d04da157e0 100644 --- a/lib/libcapsicum/libcapsicum.c +++ b/lib/libcapsicum/libcapsicum.c @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -44,7 +45,6 @@ __FBSDID("$FreeBSD$"); #include "libcapsicum.h" #include "libcapsicum_impl.h" -#include "nv.h" /* * Structure describing communication channel between two separated processes. diff --git a/lib/libcapsicum/libcapsicum_dns.c b/lib/libcapsicum/libcapsicum_dns.c index a180b6b3b0ae8..5f54283a460cc 100644 --- a/lib/libcapsicum/libcapsicum_dns.c +++ b/lib/libcapsicum/libcapsicum_dns.c @@ -30,14 +30,14 @@ #include __FBSDID("$FreeBSD$"); +#include + #include #include #include #include #include -#include - #include "libcapsicum.h" #include "libcapsicum_dns.h" diff --git a/lib/libcapsicum/libcapsicum_grp.c b/lib/libcapsicum/libcapsicum_grp.c index 267ac68c28f2b..44d573e77b820 100644 --- a/lib/libcapsicum/libcapsicum_grp.c +++ b/lib/libcapsicum/libcapsicum_grp.c @@ -30,6 +30,8 @@ #include __FBSDID("$FreeBSD$"); +#include +#include #include #include @@ -39,9 +41,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include - #include "libcapsicum.h" #include "libcapsicum_grp.h" diff --git a/lib/libcapsicum/libcapsicum_pwd.c b/lib/libcapsicum/libcapsicum_pwd.c index 32eeeb022462c..5b44c3463def7 100644 --- a/lib/libcapsicum/libcapsicum_pwd.c +++ b/lib/libcapsicum/libcapsicum_pwd.c @@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include @@ -39,8 +40,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include - #include "libcapsicum.h" #include "libcapsicum_pwd.h" diff --git a/lib/libcapsicum/libcapsicum_random.c b/lib/libcapsicum/libcapsicum_random.c index 2c3eb36357670..2a7b109cd47a3 100644 --- a/lib/libcapsicum/libcapsicum_random.c +++ b/lib/libcapsicum/libcapsicum_random.c @@ -30,12 +30,12 @@ #include __FBSDID("$FreeBSD$"); +#include + #include #include #include -#include - #include "libcapsicum.h" #include "libcapsicum_random.h" diff --git a/lib/libcapsicum/libcapsicum_service.c b/lib/libcapsicum/libcapsicum_service.c index edfde8cc0a432..6b6ceeac08de4 100644 --- a/lib/libcapsicum/libcapsicum_service.c +++ b/lib/libcapsicum/libcapsicum_service.c @@ -30,12 +30,13 @@ #include __FBSDID("$FreeBSD$"); +#include + #include #include #include #include -#include #include "msgio.h" #include "libcapsicum.h" diff --git a/lib/libcapsicum/libcapsicum_sysctl.c b/lib/libcapsicum/libcapsicum_sysctl.c index fc691136cd0b0..3f1ccd9116c06 100644 --- a/lib/libcapsicum/libcapsicum_sysctl.c +++ b/lib/libcapsicum/libcapsicum_sysctl.c @@ -30,11 +30,11 @@ #include __FBSDID("$FreeBSD$"); +#include + #include #include -#include - #include "libcapsicum.h" #include "libcapsicum_sysctl.h" diff --git a/lib/libcasper/libcasper.c b/lib/libcasper/libcasper.c index cb95346ec161d..e241888aa95eb 100644 --- a/lib/libcasper/libcasper.c +++ b/lib/libcasper/libcasper.c @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -52,7 +53,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include /* diff --git a/lib/libnv/Makefile b/lib/libnv/Makefile index 8b2fc7821d7ad..93ccc7ac80273 100644 --- a/lib/libnv/Makefile +++ b/lib/libnv/Makefile @@ -15,9 +15,6 @@ SRCS+= msgio.c SRCS+= subr_nvlist.c SRCS+= subr_nvpair.c -INCS= dnv.h -INCS+= nv.h - MAN+= nv.3 MLINKS+=nv.3 libnv.3 \ diff --git a/lib/libnv/tests/dnv_tests.cc b/lib/libnv/tests/dnv_tests.cc index 2f92d9d866d9a..fe80d00f48512 100644 --- a/lib/libnv/tests/dnv_tests.cc +++ b/lib/libnv/tests/dnv_tests.cc @@ -27,9 +27,10 @@ #include __FBSDID("$FreeBSD$"); +#include +#include + #include -#include -#include ATF_TEST_CASE_WITHOUT_HEAD(dnvlist_get_bool__present); ATF_TEST_CASE_BODY(dnvlist_get_bool__present) diff --git a/lib/libnv/tests/nv_tests.cc b/lib/libnv/tests/nv_tests.cc index d77919078a508..1c65b6664ffd4 100644 --- a/lib/libnv/tests/nv_tests.cc +++ b/lib/libnv/tests/nv_tests.cc @@ -27,8 +27,9 @@ #include __FBSDID("$FreeBSD$"); +#include + #include -#include #include #include diff --git a/lib/libnv/tests/nvlist_add_test.c b/lib/libnv/tests/nvlist_add_test.c index 06bcc639df94e..04486f3523632 100644 --- a/lib/libnv/tests/nvlist_add_test.c +++ b/lib/libnv/tests/nvlist_add_test.c @@ -29,12 +29,12 @@ * $FreeBSD$ */ +#include + #include #include #include -#include - static int ntest = 1; #define CHECK(expr) do { \ diff --git a/lib/libnv/tests/nvlist_exists_test.c b/lib/libnv/tests/nvlist_exists_test.c index cb595d7b78411..b4596fb6edba5 100644 --- a/lib/libnv/tests/nvlist_exists_test.c +++ b/lib/libnv/tests/nvlist_exists_test.c @@ -29,11 +29,11 @@ * $FreeBSD$ */ +#include + #include #include -#include - static int ntest = 1; #define CHECK(expr) do { \ diff --git a/lib/libnv/tests/nvlist_free_test.c b/lib/libnv/tests/nvlist_free_test.c index 4417a44649740..74ab785508b74 100644 --- a/lib/libnv/tests/nvlist_free_test.c +++ b/lib/libnv/tests/nvlist_free_test.c @@ -29,11 +29,11 @@ * $FreeBSD$ */ +#include + #include #include -#include - static int ntest = 1; #define CHECK(expr) do { \ diff --git a/lib/libnv/tests/nvlist_get_test.c b/lib/libnv/tests/nvlist_get_test.c index b4468db88b110..f67da908831f7 100644 --- a/lib/libnv/tests/nvlist_get_test.c +++ b/lib/libnv/tests/nvlist_get_test.c @@ -28,6 +28,7 @@ * * $FreeBSD$ */ +#include #include #include @@ -35,8 +36,6 @@ #include #include -#include - static int ntest = 1; #define CHECK(expr) do { \ diff --git a/lib/libnv/tests/nvlist_move_test.c b/lib/libnv/tests/nvlist_move_test.c index 760399da26311..7499faac7388d 100644 --- a/lib/libnv/tests/nvlist_move_test.c +++ b/lib/libnv/tests/nvlist_move_test.c @@ -29,14 +29,14 @@ * $FreeBSD$ */ +#include + #include #include #include #include #include -#include - static int ntest = 1; #define CHECK(expr) do { \ diff --git a/lib/libnv/tests/nvlist_send_recv_test.c b/lib/libnv/tests/nvlist_send_recv_test.c index 50222fbb8e397..f4bc1c4464bca 100644 --- a/lib/libnv/tests/nvlist_send_recv_test.c +++ b/lib/libnv/tests/nvlist_send_recv_test.c @@ -32,6 +32,7 @@ #include #include #include +#include #include #include @@ -40,8 +41,6 @@ #include #include -#include - static int ntest = 1; #define CHECK(expr) do { \ diff --git a/libexec/casper/dns/dns.c b/libexec/casper/dns/dns.c index f82801e42ddcb..dbdb2a27d83b2 100644 --- a/libexec/casper/dns/dns.c +++ b/libexec/casper/dns/dns.c @@ -30,6 +30,7 @@ #include __FBSDID("$FreeBSD$"); +#include #include #include @@ -41,7 +42,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include static bool diff --git a/libexec/casper/grp/grp.c b/libexec/casper/grp/grp.c index ab28e1a933d82..5b3e13d9415de 100644 --- a/libexec/casper/grp/grp.c +++ b/libexec/casper/grp/grp.c @@ -30,6 +30,8 @@ #include __FBSDID("$FreeBSD$"); +#include + #include #include #include @@ -38,7 +40,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include static bool diff --git a/libexec/casper/pwd/pwd.c b/libexec/casper/pwd/pwd.c index be51ad0c22171..0a06c5f6bfd77 100644 --- a/libexec/casper/pwd/pwd.c +++ b/libexec/casper/pwd/pwd.c @@ -30,6 +30,8 @@ #include __FBSDID("$FreeBSD$"); +#include + #include #include #include @@ -37,7 +39,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include static bool diff --git a/libexec/casper/random/random.c b/libexec/casper/random/random.c index 56f1afbf0354d..db91685a0eaa5 100644 --- a/libexec/casper/random/random.c +++ b/libexec/casper/random/random.c @@ -30,13 +30,14 @@ #include __FBSDID("$FreeBSD$"); +#include + #include #include #include #include #include -#include #include #define MAXSIZE (1024 * 1024) diff --git a/libexec/casper/sysctl/sysctl.c b/libexec/casper/sysctl/sysctl.c index 8bb43b6b8bd1b..4cbc505630a7e 100644 --- a/libexec/casper/sysctl/sysctl.c +++ b/libexec/casper/sysctl/sysctl.c @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -40,7 +41,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include static int diff --git a/sbin/casperd/casperd.c b/sbin/casperd/casperd.c index f83881107de73..7277b9890a6e2 100644 --- a/sbin/casperd/casperd.c +++ b/sbin/casperd/casperd.c @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -56,7 +57,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include "msgio.h" diff --git a/sbin/casperd/zygote.c b/sbin/casperd/zygote.c index c460bd322b927..2e17f917d6f53 100644 --- a/sbin/casperd/zygote.c +++ b/sbin/casperd/zygote.c @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -46,7 +47,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include "zygote.h" diff --git a/tools/regression/capsicum/libcapsicum/sysctl.c b/tools/regression/capsicum/libcapsicum/sysctl.c index c72e842dfd741..f3ae307383466 100644 --- a/tools/regression/capsicum/libcapsicum/sysctl.c +++ b/tools/regression/capsicum/libcapsicum/sysctl.c @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -46,7 +47,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include /* * We need some sysctls to perform the tests on. diff --git a/usr.bin/kdump/kdump.c b/usr.bin/kdump/kdump.c index 2f6c1e7cb6ce8..d8b6ccd1298c1 100644 --- a/usr.bin/kdump/kdump.c +++ b/usr.bin/kdump/kdump.c @@ -61,6 +61,9 @@ extern int errno; #include #include #include +#ifdef HAVE_LIBCAPSICUM +#include +#endif #include #include #include @@ -77,9 +80,6 @@ extern int errno; #include #include #include -#ifdef HAVE_LIBCAPSICUM -#include -#endif #include #include #include diff --git a/usr.sbin/iovctl/iovctl.c b/usr.sbin/iovctl/iovctl.c index dbf29d81c7323..6c69f529a4b46 100644 --- a/usr.sbin/iovctl/iovctl.c +++ b/usr.sbin/iovctl/iovctl.c @@ -29,12 +29,12 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include -#include #include #include #include -#include #include #include #include diff --git a/usr.sbin/iovctl/parse.c b/usr.sbin/iovctl/parse.c index 50e73b1534f49..b2ec395bc57d8 100644 --- a/usr.sbin/iovctl/parse.c +++ b/usr.sbin/iovctl/parse.c @@ -29,12 +29,12 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include #include -#include #include #include #include diff --git a/usr.sbin/iovctl/validate.c b/usr.sbin/iovctl/validate.c index 0e3eacd163eb5..789175a9ed4c5 100644 --- a/usr.sbin/iovctl/validate.c +++ b/usr.sbin/iovctl/validate.c @@ -29,10 +29,10 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include -#include #include -#include #include #include -- cgit v1.3 From 5f4899dbfe37eba1c460b27b761bd457cfadd508 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sat, 4 Jul 2015 20:07:37 +0000 Subject: Pull in r241142 from upstream llvm trunk (by David Majnemer): [SCCP] Turn loads of null into undef instead of zero initialized values Surprisingly, this is a correctness issue: the mmx type exists for calling convention purposes, LLVM doesn't have a zero representation for them. This partially fixes PR23999. Pull in r241143 from upstream llvm trunk (by David Majnemer): [LoopUnroll] Use undef for phis with no value live We would create a phi node with a zero initialized operand instead of undef in the case where no value was originally available. This was problematic for x86_mmx which has no null value. These fix a "Cannot create a null constant of that type!" error when compiling the graphics/sdl2_gfx port with MMX enabled. Reported by: amdmi3 --- contrib/llvm/lib/Transforms/Scalar/SCCP.cpp | 2 +- contrib/llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'contrib') diff --git a/contrib/llvm/lib/Transforms/Scalar/SCCP.cpp b/contrib/llvm/lib/Transforms/Scalar/SCCP.cpp index cfc9a8e89fa09..e0e314a4328b7 100644 --- a/contrib/llvm/lib/Transforms/Scalar/SCCP.cpp +++ b/contrib/llvm/lib/Transforms/Scalar/SCCP.cpp @@ -1054,7 +1054,7 @@ void SCCPSolver::visitLoadInst(LoadInst &I) { // load null -> null if (isa(Ptr) && I.getPointerAddressSpace() == 0) - return markConstant(IV, &I, Constant::getNullValue(I.getType())); + return markConstant(IV, &I, UndefValue::get(I.getType())); // Transform load (constant global) into the value loaded. if (GlobalVariable *GV = dyn_cast(Ptr)) { diff --git a/contrib/llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp b/contrib/llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp index 8a32215a299ff..db4a5c1e5b78b 100644 --- a/contrib/llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp +++ b/contrib/llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp @@ -81,7 +81,7 @@ static void ConnectProlog(Loop *L, Value *BECount, unsigned Count, if (L->contains(PN)) { NewPN->addIncoming(PN->getIncomingValueForBlock(NewPH), OrigPH); } else { - NewPN->addIncoming(Constant::getNullValue(PN->getType()), OrigPH); + NewPN->addIncoming(UndefValue::get(PN->getType()), OrigPH); } Value *V = PN->getIncomingValueForBlock(Latch); -- cgit v1.3 From b41932d54e590b3ce95d9fddd81046f682ee724d Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sat, 4 Jul 2015 20:09:24 +0000 Subject: Add llvm patch corresponding to r285149. --- .../patch-10-llvm-r241142-r241143-mmx-undef.diff | 88 ++++++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 contrib/llvm/patches/patch-10-llvm-r241142-r241143-mmx-undef.diff (limited to 'contrib') diff --git a/contrib/llvm/patches/patch-10-llvm-r241142-r241143-mmx-undef.diff b/contrib/llvm/patches/patch-10-llvm-r241142-r241143-mmx-undef.diff new file mode 100644 index 0000000000000..1750e74389544 --- /dev/null +++ b/contrib/llvm/patches/patch-10-llvm-r241142-r241143-mmx-undef.diff @@ -0,0 +1,88 @@ +Pull in r241142 from upstream llvm trunk (by David Majnemer): + + [SCCP] Turn loads of null into undef instead of zero initialized values + + Surprisingly, this is a correctness issue: the mmx type exists for + calling convention purposes, LLVM doesn't have a zero representation for + them. + + This partially fixes PR23999. + +Pull in r241143 from upstream llvm trunk (by David Majnemer): + + [LoopUnroll] Use undef for phis with no value live + + We would create a phi node with a zero initialized operand instead of + undef in the case where no value was originally available. This was + problematic for x86_mmx which has no null value. + +These fix a "Cannot create a null constant of that type!" error when +compiling the graphics/sdl2_gfx port with MMX enabled. + +Introduced here: http://svnweb.freebsd.org/changeset/base/285149 + +Index: lib/Transforms/Scalar/SCCP.cpp +=================================================================== +--- lib/Transforms/Scalar/SCCP.cpp ++++ lib/Transforms/Scalar/SCCP.cpp +@@ -1054,7 +1054,7 @@ + + // load null -> null + if (isa(Ptr) && I.getPointerAddressSpace() == 0) +- return markConstant(IV, &I, Constant::getNullValue(I.getType())); ++ return markConstant(IV, &I, UndefValue::get(I.getType())); + + // Transform load (constant global) into the value loaded. + if (GlobalVariable *GV = dyn_cast(Ptr)) { +Index: lib/Transforms/Utils/LoopUnrollRuntime.cpp +=================================================================== +--- lib/Transforms/Utils/LoopUnrollRuntime.cpp ++++ lib/Transforms/Utils/LoopUnrollRuntime.cpp +@@ -81,7 +81,7 @@ + if (L->contains(PN)) { + NewPN->addIncoming(PN->getIncomingValueForBlock(NewPH), OrigPH); + } else { +- NewPN->addIncoming(Constant::getNullValue(PN->getType()), OrigPH); ++ NewPN->addIncoming(UndefValue::get(PN->getType()), OrigPH); + } + + Value *V = PN->getIncomingValueForBlock(Latch); +Index: test/Transforms/LoopUnroll/X86/mmx.ll +=================================================================== +--- test/Transforms/LoopUnroll/X86/mmx.ll ++++ test/Transforms/LoopUnroll/X86/mmx.ll +@@ -0,0 +1,21 @@ ++; RUN: opt < %s -S -loop-unroll | FileCheck %s ++target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" ++target triple = "x86_64-unknown-linux-gnu" ++ ++define x86_mmx @f() #0 { ++entry: ++ br label %for.body ++ ++for.body: ; preds = %for.body, %entry ++ %phi = phi i32 [ 1, %entry ], [ %add, %for.body ] ++ %add = add i32 %phi, 1 ++ %cmp = icmp eq i32 %phi, 0 ++ br i1 %cmp, label %exit, label %for.body ++ ++exit: ; preds = %for.body ++ %ret = phi x86_mmx [ undef, %for.body ] ++ ; CHECK: ret x86_mmx %ret ++ ret x86_mmx %ret ++} ++ ++attributes #0 = { "target-cpu"="x86-64" } +Index: test/Transforms/SCCP/crash.ll +=================================================================== +--- test/Transforms/SCCP/crash.ll ++++ test/Transforms/SCCP/crash.ll +@@ -27,3 +27,8 @@ + %B = extractvalue [4 x i32] %A, 1 + ret i32 %B + } ++ ++define x86_mmx @test3() { ++ %load = load x86_mmx* null ++ ret x86_mmx %load ++} -- cgit v1.3