From owner-svn-src-stable-9@FreeBSD.ORG Sun Dec 8 02:48:07 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6215F3AC; Sun, 8 Dec 2013 02:48:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4E23A1A59; Sun, 8 Dec 2013 02:48:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rB82m7lg047648; Sun, 8 Dec 2013 02:48:07 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rB82m7HY047647; Sun, 8 Dec 2013 02:48:07 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201312080248.rB82m7HY047647@svn.freebsd.org> From: Warner Losh Date: Sun, 8 Dec 2013 02:48:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r259090 - stable/9/sys/arm/conf X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Dec 2013 02:48:07 -0000 Author: imp Date: Sun Dec 8 02:48:06 2013 New Revision: 259090 URL: http://svnweb.freebsd.org/changeset/base/259090 Log: 4096 is 4MB, and macb doesn't even come close to working, so don't say it is an altenative. It hasn't worked in quite some time. The die hards can still try to use macb in the tree if they want... Modified: stable/9/sys/arm/conf/SAM9G20EK Modified: stable/9/sys/arm/conf/SAM9G20EK ============================================================================== --- stable/9/sys/arm/conf/SAM9G20EK Sun Dec 8 00:59:04 2013 (r259089) +++ stable/9/sys/arm/conf/SAM9G20EK Sun Dec 8 02:48:06 2013 (r259090) @@ -37,18 +37,18 @@ options FFS #Berkeley Fast Filesystem #options UFS_ACL #Support for access control lists #options UFS_DIRHASH #Improve performance on big directories #options MD_ROOT #MD is a potential root device -#options MD_ROOT_SIZE=4096 # 3MB ram disk +#options MD_ROOT_SIZE=4096 #4MB ram disk options NFSCL #New Network Filesystem Client -#options NFSD #New Network Filesystem Server -#options NFSLOCKD #Network Lock Manager -#options NFS_ROOT #NFS usable as /, requires NFSCL -#options BOOTP_NFSROOT -#options BOOTP -#options BOOTP_NFSV3 -#options BOOTP_WIRED_TO=ate0 -#options BOOTP_COMPAT +options NFSD #New Network Filesystem Server +options NFSLOCKD #Network Lock Manager +options NFS_ROOT #NFS usable as /, requires NFSCL +options BOOTP_NFSROOT +options BOOTP +options BOOTP_NFSV3 +options BOOTP_WIRED_TO=ate0 +options BOOTP_COMPAT -options ROOTDEVNAME=\"ufs:/dev/mmcsd0s1a\" +#options ROOTDEVNAME=\"ufs:/dev/mmcsd0s1a\" options ALT_BREAK_TO_DEBUGGER @@ -86,7 +86,6 @@ device uart # Serial Ports # Ethernet device ate # Ethernet Driver -#device macb # Alternate Ethernet driver device mii option AT91_ATE_USE_RMII From owner-svn-src-stable-9@FreeBSD.ORG Sun Dec 8 03:49:46 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8ED8723B; Sun, 8 Dec 2013 03:49:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7A35D1EB3; Sun, 8 Dec 2013 03:49:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rB83nkX7070670; Sun, 8 Dec 2013 03:49:46 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rB83nkhC070669; Sun, 8 Dec 2013 03:49:46 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201312080349.rB83nkhC070669@svn.freebsd.org> From: Warner Losh Date: Sun, 8 Dec 2013 03:49:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r259093 - stable/9/sys/arm/arm X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Dec 2013 03:49:46 -0000 Author: imp Date: Sun Dec 8 03:49:45 2013 New Revision: 259093 URL: http://svnweb.freebsd.org/changeset/base/259093 Log: MFC: r246881 | ian | 2013-02-16 13:43:16 -0700 (Sat, 16 Feb 2013) | 4 lines In _bus_dmamap_addseg(), the return value must be zero for error, or the size actually added to the segment (possibly smaller than the requested size if boundary crossings had to be avoided). This fixes NFS root on Atmel platforms, and likely others. Modified: stable/9/sys/arm/arm/busdma_machdep.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/sys/ (props changed) Modified: stable/9/sys/arm/arm/busdma_machdep.c ============================================================================== --- stable/9/sys/arm/arm/busdma_machdep.c Sun Dec 8 03:02:44 2013 (r259092) +++ stable/9/sys/arm/arm/busdma_machdep.c Sun Dec 8 03:49:45 2013 (r259093) @@ -913,7 +913,7 @@ _bus_dmamap_addseg(bus_dma_tag_t dmat, b dr = _bus_dma_inrange(dmat->ranges, dmat->_nranges, curaddr); if (dr == NULL) - return (EINVAL); + return (0); /* * In a valid DMA range. Translate the physical * memory address to an address in the DMA window. @@ -935,12 +935,12 @@ _bus_dmamap_addseg(bus_dma_tag_t dmat, b segs[seg].ds_len += sgsize; } else { if (++seg >= dmat->nsegments) - return (EFBIG); + return (0); segs[seg].ds_addr = curaddr; segs[seg].ds_len = sgsize; } *segp = seg; - return (0); + return (sgsize); } /* From owner-svn-src-stable-9@FreeBSD.ORG Tue Dec 10 07:25:25 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D3282296; Tue, 10 Dec 2013 07:25:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BCC461B18; Tue, 10 Dec 2013 07:25:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBA7PP5M017707; Tue, 10 Dec 2013 07:25:25 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBA7PPUV017705; Tue, 10 Dec 2013 07:25:25 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201312100725.rBA7PPUV017705@svn.freebsd.org> From: Dimitry Andric Date: Tue, 10 Dec 2013 07:25:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r259157 - in stable: 10/contrib/llvm/tools/clang/lib/Driver 9/contrib/llvm/tools/clang/lib/Driver X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2013 07:25:26 -0000 Author: dim Date: Tue Dec 10 07:25:25 2013 New Revision: 259157 URL: http://svnweb.freebsd.org/changeset/base/259157 Log: MFC r259053: Pull in r196590 from upstream clang trunk (by rdivacky): Move the body of GCCInstallationDetector ctor into an init() function and call it from its only user. The linux toolchain. This saves quite a lot of directory searching on other platforms. See http://docs.freebsd.org/cgi/mid.cgi?51E6FAF5.3080802 for the original discussion. With this fix, the search for gcc installations is completely eliminated on FreeBSD. Reported by: Kurt Lidl Modified: stable/9/contrib/llvm/tools/clang/lib/Driver/ToolChains.cpp stable/9/contrib/llvm/tools/clang/lib/Driver/ToolChains.h Directory Properties: stable/9/contrib/llvm/ (props changed) stable/9/contrib/llvm/tools/clang/ (props changed) Changes in other areas also in this revision: Modified: stable/10/contrib/llvm/tools/clang/lib/Driver/ToolChains.cpp stable/10/contrib/llvm/tools/clang/lib/Driver/ToolChains.h Directory Properties: stable/10/ (props changed) Modified: stable/9/contrib/llvm/tools/clang/lib/Driver/ToolChains.cpp ============================================================================== --- stable/9/contrib/llvm/tools/clang/lib/Driver/ToolChains.cpp Tue Dec 10 05:01:01 2013 (r259156) +++ stable/9/contrib/llvm/tools/clang/lib/Driver/ToolChains.cpp Tue Dec 10 07:25:25 2013 (r259157) @@ -991,7 +991,7 @@ static StringRef getGCCToolchainDir(cons return GCC_INSTALL_PREFIX; } -/// \brief Construct a GCCInstallationDetector from the driver. +/// \brief Initialize a GCCInstallationDetector from the driver. /// /// This performs all of the autodetection and sets up the various paths. /// Once constructed, a GCCInstallationDetector is essentially immutable. @@ -1000,11 +1000,9 @@ static StringRef getGCCToolchainDir(cons /// should instead pull the target out of the driver. This is currently /// necessary because the driver doesn't store the final version of the target /// triple. -Generic_GCC::GCCInstallationDetector::GCCInstallationDetector( - const Driver &D, - const llvm::Triple &TargetTriple, - const ArgList &Args) - : IsValid(false) { +void +Generic_GCC::GCCInstallationDetector::init( + const Driver &D, const llvm::Triple &TargetTriple, const ArgList &Args) { llvm::Triple MultiarchTriple = TargetTriple.isArch32Bit() ? TargetTriple.get64BitArchVariant() : TargetTriple.get32BitArchVariant(); @@ -1448,7 +1446,7 @@ void Generic_GCC::GCCInstallationDetecto Generic_GCC::Generic_GCC(const Driver &D, const llvm::Triple& Triple, const ArgList &Args) - : ToolChain(D, Triple, Args), GCCInstallation(getDriver(), Triple, Args) { + : ToolChain(D, Triple, Args), GCCInstallation() { getProgramPaths().push_back(getDriver().getInstalledDir()); if (getDriver().getInstalledDir() != getDriver().Dir) getProgramPaths().push_back(getDriver().Dir); @@ -2211,6 +2209,7 @@ static StringRef getMultilibDir(const ll Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args) : Generic_ELF(D, Triple, Args) { + GCCInstallation.init(D, Triple, Args); llvm::Triple::ArchType Arch = Triple.getArch(); std::string SysRoot = computeSysRoot(Args); Modified: stable/9/contrib/llvm/tools/clang/lib/Driver/ToolChains.h ============================================================================== --- stable/9/contrib/llvm/tools/clang/lib/Driver/ToolChains.h Tue Dec 10 05:01:01 2013 (r259156) +++ stable/9/contrib/llvm/tools/clang/lib/Driver/ToolChains.h Tue Dec 10 07:25:25 2013 (r259157) @@ -78,7 +78,8 @@ protected: GCCVersion Version; public: - GCCInstallationDetector(const Driver &D, const llvm::Triple &TargetTriple, + GCCInstallationDetector() : IsValid(false) {} + void init(const Driver &D, const llvm::Triple &TargetTriple, const ArgList &Args); /// \brief Check whether we detected a valid GCC install. From owner-svn-src-stable-9@FreeBSD.ORG Tue Dec 10 07:28:27 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6FB52515; Tue, 10 Dec 2013 07:28:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5AA411B2F; Tue, 10 Dec 2013 07:28:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBA7SRtl018251; Tue, 10 Dec 2013 07:28:27 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBA7SRI4018249; Tue, 10 Dec 2013 07:28:27 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201312100728.rBA7SRI4018249@svn.freebsd.org> From: Dimitry Andric Date: Tue, 10 Dec 2013 07:28:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r259158 - in stable: 10/share/mk 9/share/mk X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2013 07:28:27 -0000 Author: dim Date: Tue Dec 10 07:28:26 2013 New Revision: 259158 URL: http://svnweb.freebsd.org/changeset/base/259158 Log: MFC r259083: For WARNS <= 3, change the clang warning flag -Wno-conversion to -Wno-enum-conversion. In earlier clang versions (before 3.2), the latter did not exist, and suppressing enum conversion warnings was really the goal of this warning suppression flag. This should enable the same kind of warning again as was fixed by r259072 ("incompatible integer to pointer conversion passing 'Elf_Addr' (aka 'unsigned int') to parameter of type 'void *'"), and which was only emitted by gcc. Noticed by: kib Modified: stable/9/share/mk/bsd.sys.mk (contents, props changed) Directory Properties: stable/9/share/mk/ (props changed) Changes in other areas also in this revision: Modified: stable/10/share/mk/bsd.sys.mk Directory Properties: stable/10/ (props changed) Modified: stable/9/share/mk/bsd.sys.mk ============================================================================== --- stable/9/share/mk/bsd.sys.mk Tue Dec 10 07:25:25 2013 (r259157) +++ stable/9/share/mk/bsd.sys.mk Tue Dec 10 07:28:26 2013 (r259158) @@ -69,7 +69,7 @@ CWARNFLAGS+= -Wno-empty-body -Wno-string .endif # WARNS <= 6 .if ${WARNS} <= 3 CWARNFLAGS+= -Wno-tautological-compare -Wno-unused-value\ - -Wno-parentheses-equality -Wno-unused-function -Wno-conversion + -Wno-parentheses-equality -Wno-unused-function -Wno-enum-conversion .endif # WARNS <= 3 .if ${WARNS} <= 2 CWARNFLAGS+= -Wno-switch -Wno-switch-enum -Wno-knr-promoted-parameter From owner-svn-src-stable-9@FreeBSD.ORG Tue Dec 10 19:48:48 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C7F5ED4C; Tue, 10 Dec 2013 19:48:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 997BD19FA; Tue, 10 Dec 2013 19:48:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBAJmmKg090145; Tue, 10 Dec 2013 19:48:48 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBAJmmOL090144; Tue, 10 Dec 2013 19:48:48 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201312101948.rBAJmmOL090144@svn.freebsd.org> From: Warner Losh Date: Tue, 10 Dec 2013 19:48:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r259190 - stable/9/sys/arm/arm X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2013 19:48:48 -0000 Author: imp Date: Tue Dec 10 19:48:48 2013 New Revision: 259190 URL: http://svnweb.freebsd.org/changeset/base/259190 Log: Hand merge from current r235717: Implement pmap_mincore for arm. Now programs using it don't cause a flood of console messages. Reviewed by: alc@ Modified: stable/9/sys/arm/arm/pmap.c Modified: stable/9/sys/arm/arm/pmap.c ============================================================================== --- stable/9/sys/arm/arm/pmap.c Tue Dec 10 19:42:35 2013 (r259189) +++ stable/9/sys/arm/arm/pmap.c Tue Dec 10 19:48:48 2013 (r259190) @@ -4675,9 +4675,59 @@ pmap_remove_write(vm_page_t m) int pmap_mincore(pmap_t pmap, vm_offset_t addr, vm_paddr_t *locked_pa) { - printf("pmap_mincore()\n"); - - return (0); + struct l2_bucket *l2b; + pt_entry_t *ptep, pte; + vm_paddr_t pa; + vm_page_t m; + int val; + boolean_t managed; + + PMAP_LOCK(pmap); +retry: + l2b = pmap_get_l2_bucket(pmap, addr); + if (l2b == NULL) { + val = 0; + goto out; + } + ptep = &l2b->l2b_kva[l2pte_index(addr)]; + pte = *ptep; + if (!l2pte_valid(pte)) { + val = 0; + goto out; + } + val = MINCORE_INCORE; + if (pte & L2_S_PROT_W) + val |= MINCORE_MODIFIED | MINCORE_MODIFIED_OTHER; + managed = false; + pa = l2pte_pa(pte); + m = PHYS_TO_VM_PAGE(pa); + if (m != NULL && !(m->oflags & VPO_UNMANAGED)) + managed = true; + if (managed) { + /* + * The ARM pmap tries to maintain a per-mapping + * reference bit. The trouble is that it's kept in + * the PV entry, not the PTE, so it's costly to access + * here. You would need to acquire the pvh global + * lock, call pmap_find_pv(), and introduce a custom + * version of vm_page_pa_tryrelock() that releases and + * reacquires the pvh global lock. In the end, I + * doubt it's worthwhile. This may falsely report + * the given address as referenced. + */ + if ((m->md.pvh_attrs & PVF_REF) != 0) + val |= MINCORE_REFERENCED | MINCORE_REFERENCED_OTHER; + } + if ((val & (MINCORE_MODIFIED_OTHER | MINCORE_REFERENCED_OTHER)) != + (MINCORE_MODIFIED_OTHER | MINCORE_REFERENCED_OTHER) && managed) { + /* Ensure that "PHYS_TO_VM_PAGE(pa)->object" doesn't change. */ + if (vm_page_pa_tryrelock(pmap, pa, locked_pa)) + goto retry; + } else +out: + PA_UNLOCK_COND(*locked_pa); + PMAP_UNLOCK(pmap); + return (val); } From owner-svn-src-stable-9@FreeBSD.ORG Tue Dec 10 22:04:00 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 274564E3; Tue, 10 Dec 2013 22:04:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 126DC14AB; Tue, 10 Dec 2013 22:04:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBAM3xa9041732; Tue, 10 Dec 2013 22:03:59 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBAM3xfx041731; Tue, 10 Dec 2013 22:03:59 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201312102203.rBAM3xfx041731@svn.freebsd.org> From: Rick Macklem Date: Tue, 10 Dec 2013 22:03:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r259201 - stable/9/sys/fs/nfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2013 22:04:00 -0000 Author: rmacklem Date: Tue Dec 10 22:03:59 2013 New Revision: 259201 URL: http://svnweb.freebsd.org/changeset/base/259201 Log: MFC: r257598 During code inspection, I spotted that there was a code path where CLNT_CONTROL() would be called on "client" after it was released via CLNT_RELEASE(). It was unlikely that this code path gets executed and I have not heard of any problem report caused by this bug. This patch fixes the code so that this cannot happen. Modified: stable/9/sys/fs/nfs/nfs_commonkrpc.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/fs/ (props changed) Modified: stable/9/sys/fs/nfs/nfs_commonkrpc.c ============================================================================== --- stable/9/sys/fs/nfs/nfs_commonkrpc.c Tue Dec 10 21:15:18 2013 (r259200) +++ stable/9/sys/fs/nfs/nfs_commonkrpc.c Tue Dec 10 22:03:59 2013 (r259201) @@ -316,24 +316,25 @@ newnfs_connect(struct nfsmount *nmp, str mtx_lock(&nrp->nr_mtx); if (nrp->nr_client != NULL) { + mtx_unlock(&nrp->nr_mtx); /* * Someone else already connected. */ CLNT_RELEASE(client); } else { nrp->nr_client = client; + /* + * Protocols that do not require connections may be optionally + * left unconnected for servers that reply from a port other + * than NFS_PORT. + */ + if (nmp == NULL || (nmp->nm_flag & NFSMNT_NOCONN) == 0) { + mtx_unlock(&nrp->nr_mtx); + CLNT_CONTROL(client, CLSET_CONNECT, &one); + } else + mtx_unlock(&nrp->nr_mtx); } - /* - * Protocols that do not require connections may be optionally left - * unconnected for servers that reply from a port other than NFS_PORT. - */ - if (nmp == NULL || (nmp->nm_flag & NFSMNT_NOCONN) == 0) { - mtx_unlock(&nrp->nr_mtx); - CLNT_CONTROL(client, CLSET_CONNECT, &one); - } else { - mtx_unlock(&nrp->nr_mtx); - } /* Restore current thread's credentials. */ td->td_ucred = origcred; From owner-svn-src-stable-9@FreeBSD.ORG Wed Dec 11 07:34:34 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B7995A7A; Wed, 11 Dec 2013 07:34:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A2A4112D6; Wed, 11 Dec 2013 07:34:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBB7YYYd051119; Wed, 11 Dec 2013 07:34:34 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBB7YYsh051118; Wed, 11 Dec 2013 07:34:34 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201312110734.rBB7YYsh051118@svn.freebsd.org> From: Dimitry Andric Date: Wed, 11 Dec 2013 07:34:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r259214 - in stable: 10/contrib/llvm/tools/clang/lib/CodeGen 9/contrib/llvm/tools/clang/lib/CodeGen X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Dec 2013 07:34:34 -0000 Author: dim Date: Wed Dec 11 07:34:34 2013 New Revision: 259214 URL: http://svnweb.freebsd.org/changeset/base/259214 Log: MFC r259100: Pull in r196658 from upstream clang trunk: CodeGen: Don't emit linkage on thunks that aren't emitted because they're vararg. This can happen when we're trying to emit a thunk with available_externally linkage with optimization enabled but bail because it doesn't make sense for vararg functions. [LLVM] PR18098. This should fix clang "Broken module found, compilation aborted" errors when building the qt4-based dvbcut port. Reported by: se Modified: stable/9/contrib/llvm/tools/clang/lib/CodeGen/CGVTables.cpp Directory Properties: stable/9/contrib/llvm/ (props changed) stable/9/contrib/llvm/tools/clang/ (props changed) Changes in other areas also in this revision: Modified: stable/10/contrib/llvm/tools/clang/lib/CodeGen/CGVTables.cpp Directory Properties: stable/10/ (props changed) Modified: stable/9/contrib/llvm/tools/clang/lib/CodeGen/CGVTables.cpp ============================================================================== --- stable/9/contrib/llvm/tools/clang/lib/CodeGen/CGVTables.cpp Wed Dec 11 06:28:44 2013 (r259213) +++ stable/9/contrib/llvm/tools/clang/lib/CodeGen/CGVTables.cpp Wed Dec 11 07:34:34 2013 (r259214) @@ -454,10 +454,9 @@ void CodeGenVTables::EmitThunk(GlobalDec } else { // Normal thunk body generation. CodeGenFunction(CGM).GenerateThunk(ThunkFn, FnInfo, GD, Thunk); + if (UseAvailableExternallyLinkage) + ThunkFn->setLinkage(llvm::GlobalValue::AvailableExternallyLinkage); } - - if (UseAvailableExternallyLinkage) - ThunkFn->setLinkage(llvm::GlobalValue::AvailableExternallyLinkage); } void CodeGenVTables::MaybeEmitThunkAvailableExternally(GlobalDecl GD, From owner-svn-src-stable-9@FreeBSD.ORG Wed Dec 11 07:43:31 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 495ABF8A; Wed, 11 Dec 2013 07:43:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1B05113AB; Wed, 11 Dec 2013 07:43:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBB7hUI1054571; Wed, 11 Dec 2013 07:43:30 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBB7hU64054570; Wed, 11 Dec 2013 07:43:30 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201312110743.rBB7hU64054570@svn.freebsd.org> From: Dimitry Andric Date: Wed, 11 Dec 2013 07:43:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r259216 - in stable: 10/contrib/gcc/config/i386 9/contrib/gcc/config/i386 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Dec 2013 07:43:31 -0000 Author: dim Date: Wed Dec 11 07:43:30 2013 New Revision: 259216 URL: http://svnweb.freebsd.org/changeset/base/259216 Log: MFC r259111: Use correct casts in gcc's emmintrin.h for the first arguments of the following builtin functions: * __builtin_ia32_pslldi128() takes __v4si instead of __v8hi * __builtin_ia32_psllqi128() takes __v2di instead of __v8hi * __builtin_ia32_psradi128() takes __v4si instead of __v8hi This should fix the following errors when building the LINT kernel with gcc: sys/crypto/aesni/aesni_wrap.c:191: error: incompatible type for argument 1 of '__builtin_ia32_psradi128' sys/crypto/aesni/aesni_wrap.c:195: error: incompatible type for argument 1 of '__builtin_ia32_pslldi128' Modified: stable/9/contrib/gcc/config/i386/emmintrin.h Directory Properties: stable/9/contrib/gcc/ (props changed) Changes in other areas also in this revision: Modified: stable/10/contrib/gcc/config/i386/emmintrin.h Directory Properties: stable/10/ (props changed) Modified: stable/9/contrib/gcc/config/i386/emmintrin.h ============================================================================== --- stable/9/contrib/gcc/config/i386/emmintrin.h Wed Dec 11 07:41:28 2013 (r259215) +++ stable/9/contrib/gcc/config/i386/emmintrin.h Wed Dec 11 07:43:30 2013 (r259216) @@ -1126,9 +1126,9 @@ _mm_slli_epi64 (__m128i __A, int __B) #define _mm_slli_epi16(__A, __B) \ ((__m128i)__builtin_ia32_psllwi128 ((__v8hi)(__A), __B)) #define _mm_slli_epi32(__A, __B) \ - ((__m128i)__builtin_ia32_pslldi128 ((__v8hi)(__A), __B)) + ((__m128i)__builtin_ia32_pslldi128 ((__v4si)(__A), __B)) #define _mm_slli_epi64(__A, __B) \ - ((__m128i)__builtin_ia32_psllqi128 ((__v8hi)(__A), __B)) + ((__m128i)__builtin_ia32_psllqi128 ((__v2di)(__A), __B)) #endif #if 0 @@ -1147,7 +1147,7 @@ _mm_srai_epi32 (__m128i __A, int __B) #define _mm_srai_epi16(__A, __B) \ ((__m128i)__builtin_ia32_psrawi128 ((__v8hi)(__A), __B)) #define _mm_srai_epi32(__A, __B) \ - ((__m128i)__builtin_ia32_psradi128 ((__v8hi)(__A), __B)) + ((__m128i)__builtin_ia32_psradi128 ((__v4si)(__A), __B)) #endif #if 0 From owner-svn-src-stable-9@FreeBSD.ORG Wed Dec 11 19:25:40 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8026EF6D; Wed, 11 Dec 2013 19:25:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 603CC1F74; Wed, 11 Dec 2013 19:25:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBBJPeOM012628; Wed, 11 Dec 2013 19:25:40 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBBJPd0m012620; Wed, 11 Dec 2013 19:25:39 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201312111925.rBBJPd0m012620@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Wed, 11 Dec 2013 19:25:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r259224 - in stable/9: sbin/fsck_ffs sbin/growfs sys/fs/ext2fs sys/ufs/ffs sys/ufs/ufs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Dec 2013 19:25:40 -0000 Author: pfg Date: Wed Dec 11 19:25:38 2013 New Revision: 259224 URL: http://svnweb.freebsd.org/changeset/base/259224 Log: MFC r256448, r257029; Make di_blocks unsigned in UFS1 as is the case already for UFS2. Most of the code between UFS1 and UFS2 is shared so this change is pretty safe. Not only this makes UFS1 and 2 consistent but it also matches what NetBSD and MacOS X have for some years now. UFS2: make di_extsize unsigned. di_extsize is the EA size and as such it should be unsigned. Adjust related types for consistency. Reviewed by: mckusick Modified: stable/9/sbin/fsck_ffs/ea.c stable/9/sbin/growfs/debug.c stable/9/sys/fs/ext2fs/ext2_vnops.c stable/9/sys/ufs/ffs/ffs_vnops.c stable/9/sys/ufs/ufs/dinode.h Directory Properties: stable/9/ (props changed) stable/9/sbin/ (props changed) stable/9/sbin/fsck_ffs/ (props changed) stable/9/sbin/growfs/ (props changed) stable/9/sys/ (props changed) stable/9/sys/fs/ (props changed) Modified: stable/9/sbin/fsck_ffs/ea.c ============================================================================== --- stable/9/sbin/fsck_ffs/ea.c Wed Dec 11 19:25:17 2013 (r259223) +++ stable/9/sbin/fsck_ffs/ea.c Wed Dec 11 19:25:38 2013 (r259224) @@ -65,7 +65,7 @@ eascan(struct inodesc *idesc, struct ufs char dbuf[DIRBLKSIZ]; printf("Inode %ju extsize %ju\n", - (intmax_t)idesc->id_number, (intmax_t)dp->di_extsize); + (intmax_t)idesc->id_number, (uintmax_t)dp->di_extsize); if (dp->di_extsize == 0) return 0; if (dp->di_extsize <= sblock.fs_fsize) Modified: stable/9/sbin/growfs/debug.c ============================================================================== --- stable/9/sbin/growfs/debug.c Wed Dec 11 19:25:17 2013 (r259223) +++ stable/9/sbin/growfs/debug.c Wed Dec 11 19:25:38 2013 (r259224) @@ -765,7 +765,7 @@ dbg_dump_ufs2_ino(struct fs *sb, const c fprintf(dbg_log, "gen int32_t 0x%08x\n", ino->di_gen); fprintf(dbg_log, "kernflags u_int32_t 0x%08x\n", ino->di_kernflags); fprintf(dbg_log, "flags u_int32_t 0x%08x\n", ino->di_flags); - fprintf(dbg_log, "extsize int32_t 0x%08x\n", ino->di_extsize); + fprintf(dbg_log, "extsize u_int32_t 0x%08x\n", ino->di_extsize); /* XXX: What do we do with di_extb[NXADDR]? */ Modified: stable/9/sys/fs/ext2fs/ext2_vnops.c ============================================================================== --- stable/9/sys/fs/ext2fs/ext2_vnops.c Wed Dec 11 19:25:17 2013 (r259223) +++ stable/9/sys/fs/ext2fs/ext2_vnops.c Wed Dec 11 19:25:38 2013 (r259224) @@ -1694,7 +1694,7 @@ ext2_ind_read(struct vop_read_args *ap) error = cluster_read(vp, ip->i_size, lbn, size, NOCRED, blkoffset + uio->uio_resid, seqcount, &bp); else if (seqcount > 1) { - int nextsize = blksize(fs, ip, nextlbn); + u_int nextsize = blksize(fs, ip, nextlbn); error = breadn(vp, lbn, size, &nextlbn, &nextsize, 1, NOCRED, &bp); } else Modified: stable/9/sys/ufs/ffs/ffs_vnops.c ============================================================================== --- stable/9/sys/ufs/ffs/ffs_vnops.c Wed Dec 11 19:25:17 2013 (r259223) +++ stable/9/sys/ufs/ffs/ffs_vnops.c Wed Dec 11 19:25:38 2013 (r259224) @@ -530,7 +530,7 @@ ffs_read(ap) * arguments point to arrays of the size specified in * the 6th argument. */ - int nextsize = blksize(fs, ip, nextlbn); + u_int nextsize = blksize(fs, ip, nextlbn); error = breadn_flags(vp, lbn, size, &nextlbn, &nextsize, 1, NOCRED, GB_UNMAPPED, &bp); } else { @@ -956,7 +956,7 @@ ffs_extread(struct vnode *vp, struct uio * arguments point to arrays of the size specified in * the 6th argument. */ - int nextsize = sblksize(fs, dp->di_extsize, nextlbn); + u_int nextsize = sblksize(fs, dp->di_extsize, nextlbn); nextlbn = -1 - nextlbn; error = breadn(vp, -1 - lbn, @@ -1218,7 +1218,8 @@ ffs_rdextattr(u_char **p, struct vnode * struct fs *fs; struct uio luio; struct iovec liovec; - int easize, error; + u_int easize; + int error; u_char *eae; ip = VTOI(vp); Modified: stable/9/sys/ufs/ufs/dinode.h ============================================================================== --- stable/9/sys/ufs/ufs/dinode.h Wed Dec 11 19:25:17 2013 (r259223) +++ stable/9/sys/ufs/ufs/dinode.h Wed Dec 11 19:25:38 2013 (r259224) @@ -141,7 +141,7 @@ struct ufs2_dinode { u_int32_t di_gen; /* 80: Generation number. */ u_int32_t di_kernflags; /* 84: Kernel flags. */ u_int32_t di_flags; /* 88: Status flags (chflags). */ - int32_t di_extsize; /* 92: External attributes block. */ + u_int32_t di_extsize; /* 92: External attributes size. */ ufs2_daddr_t di_extb[NXADDR];/* 96: External attributes block. */ ufs2_daddr_t di_db[NDADDR]; /* 112: Direct disk blocks. */ ufs2_daddr_t di_ib[NIADDR]; /* 208: Indirect disk blocks. */ @@ -179,7 +179,7 @@ struct ufs1_dinode { ufs1_daddr_t di_db[NDADDR]; /* 40: Direct disk blocks. */ ufs1_daddr_t di_ib[NIADDR]; /* 88: Indirect disk blocks. */ u_int32_t di_flags; /* 100: Status flags (chflags). */ - int32_t di_blocks; /* 104: Blocks actually held. */ + u_int32_t di_blocks; /* 104: Blocks actually held. */ u_int32_t di_gen; /* 108: Generation number. */ u_int32_t di_uid; /* 112: File owner. */ u_int32_t di_gid; /* 116: File group. */ From owner-svn-src-stable-9@FreeBSD.ORG Thu Dec 12 02:05:00 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 61116F57; Thu, 12 Dec 2013 02:05:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4D0731F63; Thu, 12 Dec 2013 02:05:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBC250k2060656; Thu, 12 Dec 2013 02:05:00 GMT (envelope-from mdf@svn.freebsd.org) Received: (from mdf@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBC250iP060654; Thu, 12 Dec 2013 02:05:00 GMT (envelope-from mdf@svn.freebsd.org) Message-Id: <201312120205.rBC250iP060654@svn.freebsd.org> From: Matthew D Fleming Date: Thu, 12 Dec 2013 02:05:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r259243 - stable/9/contrib/gcclibs/libcpp X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Dec 2013 02:05:00 -0000 Author: mdf Date: Thu Dec 12 02:04:59 2013 New Revision: 259243 URL: http://svnweb.freebsd.org/changeset/base/259243 Log: MFC r258658: Fix a segfault / internal compiler error. Among other causes, when gcc throws a warning before parsing any tokens, the cur_token pointer is at the beginning of malloc'd memory. Dereferencing cur_token[-1] can cause a segfault. Code taken from OpenBSD http://www.openbsd.org/cgi-bin/cvsweb/src/gnu/gcc/libcpp/errors.c which was a more complete fix than the one I originally coded. Modified: stable/9/contrib/gcclibs/libcpp/errors.c Directory Properties: stable/9/contrib/gcclibs/ (props changed) Modified: stable/9/contrib/gcclibs/libcpp/errors.c ============================================================================== --- stable/9/contrib/gcclibs/libcpp/errors.c Thu Dec 12 02:03:42 2013 (r259242) +++ stable/9/contrib/gcclibs/libcpp/errors.c Thu Dec 12 02:04:59 2013 (r259243) @@ -153,7 +153,20 @@ cpp_error (cpp_reader * pfile, int level } else { - src_loc = pfile->cur_token[-1].src_loc; + /* Find actual previous token. */ + cpp_token *t; + + if (pfile->cur_token != pfile->cur_run->base) + t = pfile->cur_token - 1; + else + { + if (pfile->cur_run->prev != NULL) + t = pfile->cur_run->prev->limit; + else + t = NULL; + } + /* Retrieve corresponding source location, unless we failed. */ + src_loc = t ? t->src_loc : 0; } if (_cpp_begin_message (pfile, level, src_loc, 0)) From owner-svn-src-stable-9@FreeBSD.ORG Thu Dec 12 15:05:02 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 249BE70A; Thu, 12 Dec 2013 15:05:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0D750194D; Thu, 12 Dec 2013 15:05:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBCF52DM052493; Thu, 12 Dec 2013 15:05:02 GMT (envelope-from tijl@svn.freebsd.org) Received: (from tijl@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBCF502g052425; Thu, 12 Dec 2013 15:05:00 GMT (envelope-from tijl@svn.freebsd.org) Message-Id: <201312121505.rBCF502g052425@svn.freebsd.org> From: Tijl Coosemans Date: Thu, 12 Dec 2013 15:05:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r259262 - in stable/9/usr.bin/m4: . TEST lib X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Dec 2013 15:05:02 -0000 Author: tijl Date: Thu Dec 12 15:04:59 2013 New Revision: 259262 URL: http://svnweb.freebsd.org/changeset/base/259262 Log: MFC r226422, r227241, r228063, r228697, r228698, r228701, r234310, r234850, r250226, r250926. This brings m4 up to date with the version in head and fixes the eval command when called with a 2nd and 3rd argument. The only differences remaining are related to the updated flex and byacc in head. PR: bin/166994 Added: stable/9/usr.bin/m4/lib/ - copied from r228063, head/usr.bin/m4/lib/ stable/9/usr.bin/m4/parser.y - copied, changed from r228697, head/usr.bin/m4/parser.y stable/9/usr.bin/m4/tokenizer.l - copied, changed from r228697, head/usr.bin/m4/tokenizer.l Modified: stable/9/usr.bin/m4/Makefile stable/9/usr.bin/m4/TEST/ack.m4 stable/9/usr.bin/m4/TEST/hanoi.m4 stable/9/usr.bin/m4/TEST/hash.m4 stable/9/usr.bin/m4/TEST/sqroot.m4 stable/9/usr.bin/m4/TEST/string.m4 stable/9/usr.bin/m4/TEST/test.m4 stable/9/usr.bin/m4/eval.c stable/9/usr.bin/m4/expr.c stable/9/usr.bin/m4/extern.h stable/9/usr.bin/m4/gnum4.c stable/9/usr.bin/m4/look.c stable/9/usr.bin/m4/m4.1 stable/9/usr.bin/m4/main.c stable/9/usr.bin/m4/mdef.h stable/9/usr.bin/m4/misc.c stable/9/usr.bin/m4/pathnames.h stable/9/usr.bin/m4/stdd.h stable/9/usr.bin/m4/trace.c Directory Properties: stable/9/usr.bin/m4/ (props changed) Modified: stable/9/usr.bin/m4/Makefile ============================================================================== --- stable/9/usr.bin/m4/Makefile Thu Dec 12 14:49:26 2013 (r259261) +++ stable/9/usr.bin/m4/Makefile Thu Dec 12 15:04:59 2013 (r259262) @@ -5,10 +5,21 @@ # if you want the paste & spaste macros. PROG= m4 -CFLAGS+=-DEXTENDED +CFLAGS+=-DEXTENDED -I${.CURDIR}/lib +DPADD= ${LIBY} ${LIBL} ${LIBM} +LDADD= -ly -ll -lm +# clang needs 1 while with gcc we can use 2 +#WARNS= 1 -SRCS= eval.c expr.c look.c main.c misc.c gnum4.c trace.c +SRCS= eval.c expr.c look.c main.c misc.c gnum4.c trace.c parser.y tokenizer.l +.PATH: ${.CURDIR}/lib +SRCS+= ohash_create_entry.c ohash_delete.c ohash_do.c ohash_entries.c \ + ohash_enum.c ohash_init.c ohash_int.h ohash_interval.c \ + ohash_lookup_interval.c ohash_lookup_memory.c ohash_qlookup.c \ + ohash_qlookupi.c -WARNS?= 0 +tokenizer.o: parser.h + +CLEANFILES+= parser.c parser.h tokenizer.o .include Modified: stable/9/usr.bin/m4/TEST/ack.m4 ============================================================================== --- stable/9/usr.bin/m4/TEST/ack.m4 Thu Dec 12 14:49:26 2013 (r259261) +++ stable/9/usr.bin/m4/TEST/ack.m4 Thu Dec 12 15:04:59 2013 (r259262) @@ -1,4 +1,4 @@ -# $OpenBSD: ack.m4,v 1.2 1996/06/26 05:36:18 deraadt Exp $ +# $OpenBSD: ack.m4,v 1.3 2003/06/03 02:56:11 millert Exp $ # $NetBSD: ack.m4,v 1.4 1995/09/28 05:37:54 tls Exp $ # # Copyright (c) 1989, 1993 @@ -15,7 +15,7 @@ # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. -# 4. Neither the name of the University nor the names of its contributors +# 3. Neither the name of the University nor the names of its contributors # may be used to endorse or promote products derived from this software # without specific prior written permission. # Modified: stable/9/usr.bin/m4/TEST/hanoi.m4 ============================================================================== --- stable/9/usr.bin/m4/TEST/hanoi.m4 Thu Dec 12 14:49:26 2013 (r259261) +++ stable/9/usr.bin/m4/TEST/hanoi.m4 Thu Dec 12 15:04:59 2013 (r259262) @@ -1,4 +1,4 @@ -# $OpenBSD: hanoi.m4,v 1.2 1996/06/26 05:36:19 deraadt Exp $ +# $OpenBSD: hanoi.m4,v 1.3 2003/06/03 02:56:11 millert Exp $ # $NetBSD: hanoi.m4,v 1.4 1995/09/28 05:37:56 tls Exp $ # # Copyright (c) 1989, 1993 @@ -15,7 +15,7 @@ # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. -# 4. Neither the name of the University nor the names of its contributors +# 3. Neither the name of the University nor the names of its contributors # may be used to endorse or promote products derived from this software # without specific prior written permission. # Modified: stable/9/usr.bin/m4/TEST/hash.m4 ============================================================================== --- stable/9/usr.bin/m4/TEST/hash.m4 Thu Dec 12 14:49:26 2013 (r259261) +++ stable/9/usr.bin/m4/TEST/hash.m4 Thu Dec 12 15:04:59 2013 (r259262) @@ -1,4 +1,4 @@ -# $OpenBSD: hash.m4,v 1.2 1996/06/26 05:36:19 deraadt Exp $ +# $OpenBSD: hash.m4,v 1.3 2003/06/03 02:56:11 millert Exp $ # $NetBSD: hash.m4,v 1.4 1995/09/28 05:37:58 tls Exp $ # # Copyright (c) 1989, 1993 @@ -15,7 +15,7 @@ # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. -# 4. Neither the name of the University nor the names of its contributors +# 3. Neither the name of the University nor the names of its contributors # may be used to endorse or promote products derived from this software # without specific prior written permission. # Modified: stable/9/usr.bin/m4/TEST/sqroot.m4 ============================================================================== --- stable/9/usr.bin/m4/TEST/sqroot.m4 Thu Dec 12 14:49:26 2013 (r259261) +++ stable/9/usr.bin/m4/TEST/sqroot.m4 Thu Dec 12 15:04:59 2013 (r259262) @@ -1,4 +1,4 @@ -# $OpenBSD: sqroot.m4,v 1.2 1996/06/26 05:36:20 deraadt Exp $ +# $OpenBSD: sqroot.m4,v 1.3 2003/06/03 02:56:11 millert Exp $ # $NetBSD: sqroot.m4,v 1.4 1995/09/28 05:38:01 tls Exp $ # # Copyright (c) 1989, 1993 @@ -15,7 +15,7 @@ # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. -# 4. Neither the name of the University nor the names of its contributors +# 3. Neither the name of the University nor the names of its contributors # may be used to endorse or promote products derived from this software # without specific prior written permission. # Modified: stable/9/usr.bin/m4/TEST/string.m4 ============================================================================== --- stable/9/usr.bin/m4/TEST/string.m4 Thu Dec 12 14:49:26 2013 (r259261) +++ stable/9/usr.bin/m4/TEST/string.m4 Thu Dec 12 15:04:59 2013 (r259262) @@ -1,4 +1,4 @@ -# $OpenBSD: string.m4,v 1.2 1996/06/26 05:36:20 deraadt Exp $ +# $OpenBSD: string.m4,v 1.3 2003/06/03 02:56:11 millert Exp $ # $NetBSD: string.m4,v 1.4 1995/09/28 05:38:03 tls Exp $ # # Copyright (c) 1989, 1993 @@ -15,7 +15,7 @@ # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. -# 4. Neither the name of the University nor the names of its contributors +# 3. Neither the name of the University nor the names of its contributors # may be used to endorse or promote products derived from this software # without specific prior written permission. # Modified: stable/9/usr.bin/m4/TEST/test.m4 ============================================================================== --- stable/9/usr.bin/m4/TEST/test.m4 Thu Dec 12 14:49:26 2013 (r259261) +++ stable/9/usr.bin/m4/TEST/test.m4 Thu Dec 12 15:04:59 2013 (r259262) @@ -1,4 +1,4 @@ -# $OpenBSD: test.m4,v 1.2 1996/06/26 05:36:21 deraadt Exp $ +# $OpenBSD: test.m4,v 1.3 2003/06/03 02:56:11 millert Exp $ # $NetBSD: test.m4,v 1.4 1995/09/28 05:38:05 tls Exp $ # # Copyright (c) 1989, 1993 @@ -15,7 +15,7 @@ # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. -# 4. Neither the name of the University nor the names of its contributors +# 3. Neither the name of the University nor the names of its contributors # may be used to endorse or promote products derived from this software # without specific prior written permission. # Modified: stable/9/usr.bin/m4/eval.c ============================================================================== --- stable/9/usr.bin/m4/eval.c Thu Dec 12 14:49:26 2013 (r259261) +++ stable/9/usr.bin/m4/eval.c Thu Dec 12 15:04:59 2013 (r259262) @@ -1,4 +1,4 @@ -/* $OpenBSD: eval.c,v 1.44 2002/04/26 16:15:16 espie Exp $ */ +/* $OpenBSD: eval.c,v 1.70 2012/04/12 17:00:11 espie Exp $ */ /* $NetBSD: eval.c,v 1.7 1996/11/10 21:21:29 pk Exp $ */ /* @@ -16,7 +16,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * @@ -33,19 +33,10 @@ * SUCH DAMAGE. */ -#ifndef lint -#if 0 -static char sccsid[] = "@(#)eval.c 8.2 (Berkeley) 4/27/95"; -#else -#if 0 -static char rcsid[] = "$OpenBSD: eval.c,v 1.44 2002/04/26 16:15:16 espie Exp $"; -#endif -#endif -#endif /* not lint */ - #include __FBSDID("$FreeBSD$"); + /* * eval.c * Facility: m4 macro processor @@ -53,21 +44,21 @@ __FBSDID("$FreeBSD$"); */ #include +#include #include +#include #include +#include #include #include #include #include #include -#include #include "mdef.h" #include "stdd.h" #include "extern.h" #include "pathnames.h" -#define BUILTIN_MARKER "__builtin_" - static void dodefn(const char *); static void dopushdef(const char *, const char *); static void dodump(const char *[], int); @@ -75,10 +66,9 @@ static void dotrace(const char *[], int, static void doifelse(const char *[], int); static int doincl(const char *); static int dopaste(const char *); -static void gnu_dochq(const char *[], int); static void dochq(const char *[], int); -static void gnu_dochc(const char *[], int); static void dochc(const char *[], int); +static void dom4wrap(const char *); static void dodiv(int); static void doundiv(const char *[], int); static void dosub(const char *[], int); @@ -86,7 +76,7 @@ static void map(char *, const char *, co static const char *handledash(char *, char *, const char *); static void expand_builtin(const char *[], int, int); static void expand_macro(const char *[], int); -static void dump_one_def(ndptr); +static void dump_one_def(const char *, struct macro_definition *); unsigned long expansion_id; @@ -95,7 +85,7 @@ unsigned long expansion_id; * argc - number of elements in argv. * argv - element vector : * argv[0] = definition of a user - * macro or nil if built-in. + * macro or NULL if built-in. * argv[1] = name of the macro or * built-in. * argv[2] = parameters to user-defined @@ -110,21 +100,20 @@ unsigned long expansion_id; * argc is 3 for macro-or-builtin() and 2 for macro-or-builtin */ void -eval(const char *argv[], int argc, int td) +eval(const char *argv[], int argc, int td, int is_traced) { - ssize_t mark = -1; + size_t mark = SIZE_MAX; expansion_id++; if (td & RECDEF) - errx(1, "%s at line %lu: expanding recursive definition for %s", - CURRENT_NAME, CURRENT_LINE, argv[1]); - if (traced_macros && is_traced(argv[1])) + m4errx(1, "expanding recursive definition for %s.", argv[1]); + if (is_traced) mark = trace(argv, argc, infile+ilevel); if (td == MACRTYPE) expand_macro(argv, argc); else expand_builtin(argv, argc, td); - if (mark != -1) + if (mark != SIZE_MAX) finish_trace(mark); } @@ -150,9 +139,12 @@ expand_builtin(const char *argv[], int a * have macro-or-builtin() type call. We adjust * argc to avoid further checking.. */ - ac = argc; + /* we keep the initial value for those built-ins that differentiate + * between builtin() and builtin. + */ + ac = argc; - if (argc == 3 && !*(argv[2])) + if (argc == 3 && !*(argv[2]) && !mimic_gnu) argc--; switch (td & TYPEMASK) { @@ -184,9 +176,27 @@ expand_builtin(const char *argv[], int a * doexpr - evaluate arithmetic * expression */ + { + int base = 10; + int maxdigits = 0; + const char *errstr; + + if (argc > 3) { + base = strtonum(argv[3], 2, 36, &errstr); + if (errstr) { + m4errx(1, "expr: base %s invalid.", argv[3]); + } + } + if (argc > 4) { + maxdigits = strtonum(argv[4], 0, INT_MAX, &errstr); + if (errstr) { + m4errx(1, "expr: maxdigits %s invalid.", argv[4]); + } + } if (argc > 2) - pbnum(expr(argv[2])); + pbnumbase(expr(argv[2]), base, maxdigits); break; + } case IFELTYPE: if (argc > 4) @@ -200,7 +210,7 @@ expand_builtin(const char *argv[], int a * another definition */ if (argc > 3) { - if (lookup(argv[2]) != nil) + if (lookup_macro_definition(argv[2]) != NULL) pbstr(argv[3]); else if (argc > 4) pbstr(argv[4]); @@ -238,7 +248,7 @@ expand_builtin(const char *argv[], int a * dosys - execute system command */ if (argc > 2) { - fflush(NULL); + fflush(stdout); sysval = system(argv[2]); } break; @@ -255,12 +265,18 @@ expand_builtin(const char *argv[], int a case ESYSCMDTYPE: if (argc > 2) doesyscmd(argv[2]); - break; + break; case INCLTYPE: if (argc > 2) - if (!doincl(argv[2])) - err(1, "%s at line %lu: include(%s)", - CURRENT_NAME, CURRENT_LINE, argv[2]); + if (!doincl(argv[2])) { + if (mimic_gnu) { + warn("%s at line %lu: include(%s)", + CURRENT_NAME, CURRENT_LINE, argv[2]); + exit_code = 1; + } else + err(1, "%s at line %lu: include(%s)", + CURRENT_NAME, CURRENT_LINE, argv[2]); + } break; case SINCTYPE: @@ -271,7 +287,7 @@ expand_builtin(const char *argv[], int a case PASTTYPE: if (argc > 2) if (!dopaste(argv[2])) - err(1, "%s at line %lu: paste(%s)", + err(1, "%s at line %lu: paste(%s)", CURRENT_NAME, CURRENT_LINE, argv[2]); break; @@ -279,19 +295,16 @@ expand_builtin(const char *argv[], int a if (argc > 2) (void) dopaste(argv[2]); break; + case FORMATTYPE: + doformat(argv, argc); + break; #endif case CHNQTYPE: - if (mimic_gnu) - gnu_dochq(argv, ac); - else - dochq(argv, argc); + dochq(argv, ac); break; case CHNCTYPE: - if (mimic_gnu) - gnu_dochc(argv, ac); - else - dochc(argv, argc); + dochc(argv, argc); break; case SUBSTYPE: @@ -314,7 +327,7 @@ expand_builtin(const char *argv[], int a pbstr(rquote); pbstr(argv[n]); pbstr(lquote); - putback(COMMA); + pushback(COMMA); } pbstr(rquote); pbstr(argv[3]); @@ -350,7 +363,7 @@ expand_builtin(const char *argv[], int a */ if (argc > 2) for (n = 2; n < argc; n++) - remhash(argv[n], ALL); + macro_undefine(argv[n]); break; case POPDTYPE: @@ -361,7 +374,7 @@ expand_builtin(const char *argv[], int a */ if (argc > 2) for (n = 2; n < argc; n++) - remhash(argv[n], TOP); + macro_popdef(argv[n]); break; case MKTMTYPE: @@ -395,7 +408,7 @@ expand_builtin(const char *argv[], int a if (argc > 3) { char *temp; - temp = xalloc(strlen(argv[2])+1); + temp = xalloc(strlen(argv[2])+1, NULL); if (argc > 4) map(temp, argv[2], argv[3], argv[4]); else @@ -441,7 +454,8 @@ expand_builtin(const char *argv[], int a * dom4wrap - set up for * wrap-up/wind-down activity */ - m4wraps = (argc > 2) ? xstrdup(argv[2]) : null; + if (argc > 2) + dom4wrap(argv[2]); break; case EXITTYPE: @@ -488,8 +502,7 @@ expand_builtin(const char *argv[], int a pbstr(lquote); break; default: - errx(1, "%s at line %lu: eval: major botch.", - CURRENT_NAME, CURRENT_LINE); + m4errx(1, "eval: major botch."); break; } } @@ -512,7 +525,7 @@ expand_macro(const char *argv[], int arg p--; /* last character of defn */ while (p > t) { if (*(p - 1) != ARGFLAG) - PUTBACK(*p); + PUSHBACK(*p); else { switch (*p) { @@ -536,10 +549,10 @@ expand_macro(const char *argv[], int arg if (argc > 2) { for (n = argc - 1; n > 2; n--) { pbstr(argv[n]); - putback(COMMA); + pushback(COMMA); } pbstr(argv[2]); - } + } break; case '@': if (argc > 2) { @@ -547,7 +560,7 @@ expand_macro(const char *argv[], int arg pbstr(rquote); pbstr(argv[n]); pbstr(lquote); - putback(COMMA); + pushback(COMMA); } pbstr(rquote); pbstr(argv[2]); @@ -555,8 +568,8 @@ expand_macro(const char *argv[], int arg } break; default: - PUTBACK(*p); - PUTBACK('$'); + PUSHBACK(*p); + PUSHBACK('$'); break; } p--; @@ -564,42 +577,20 @@ expand_macro(const char *argv[], int arg p--; } if (p == t) /* do last character */ - PUTBACK(*p); + PUSHBACK(*p); } + /* * dodefine - install definition in the table */ void dodefine(const char *name, const char *defn) { - ndptr p; - int n; - - if (!*name) - errx(1, "%s at line %lu: null definition.", CURRENT_NAME, - CURRENT_LINE); - if ((p = lookup(name)) == nil) - p = addent(name); - else if (p->defn != null) - free((char *) p->defn); - if (strncmp(defn, BUILTIN_MARKER, sizeof(BUILTIN_MARKER)-1) == 0) { - n = builtin_type(defn+sizeof(BUILTIN_MARKER)-1); - if (n != -1) { - p->type = n & TYPEMASK; - if ((n & NOARGS) == 0) - p->type |= NEEDARGS; - p->defn = null; - return; - } - } - if (!*defn) - p->defn = null; + if (!*name && !mimic_gnu) + m4errx(1, "null definition."); else - p->defn = xstrdup(defn); - p->type = MACRTYPE; - if (STREQ(name, defn)) - p->type |= RECDEF; + macro_define(name, defn); } /* @@ -609,16 +600,15 @@ dodefine(const char *name, const char *d static void dodefn(const char *name) { - ndptr p; - const char *real; + struct macro_definition *p; - if ((p = lookup(name)) != nil) { - if (p->defn != null) { + if ((p = lookup_macro_definition(name)) != NULL) { + if ((p->type & TYPEMASK) == MACRTYPE) { pbstr(rquote); pbstr(p->defn); pbstr(lquote); - } else if ((real = builtin_realname(p->type)) != NULL) { - pbstr(real); + } else { + pbstr(p->defn); pbstr(BUILTIN_MARKER); } } @@ -634,40 +624,28 @@ dodefn(const char *name) static void dopushdef(const char *name, const char *defn) { - ndptr p; - - if (!*name) - errx(1, "%s at line %lu: null definition", CURRENT_NAME, - CURRENT_LINE); - p = addent(name); - if (!*defn) - p->defn = null; + if (!*name && !mimic_gnu) + m4errx(1, "null definition."); else - p->defn = xstrdup(defn); - p->type = MACRTYPE; - if (STREQ(name, defn)) - p->type |= RECDEF; + macro_pushdef(name, defn); } /* * dump_one_def - dump the specified definition. */ static void -dump_one_def(ndptr p) +dump_one_def(const char *name, struct macro_definition *p) { - const char *real; - + if (!traceout) + traceout = stderr; if (mimic_gnu) { if ((p->type & TYPEMASK) == MACRTYPE) - fprintf(traceout, "%s:\t%s\n", p->name, p->defn); + fprintf(traceout, "%s:\t%s\n", name, p->defn); else { - real = builtin_realname(p->type); - if (real == NULL) - real = null; - fprintf(traceout, "%s:\t<%s>\n", p->name, real); - } + fprintf(traceout, "%s:\t<%s>\n", name, p->defn); + } } else - fprintf(traceout, "`%s'\t`%s'\n", p->name, p->defn); + fprintf(traceout, "`%s'\t`%s'\n", name, p->defn); } /* @@ -679,17 +657,14 @@ static void dodump(const char *argv[], int argc) { int n; - ndptr p; + struct macro_definition *p; if (argc > 2) { for (n = 2; n < argc; n++) - if ((p = lookup(argv[n])) != nil) - dump_one_def(p); - } else { - for (n = 0; n < HASHSIZE; n++) - for (p = hashtab[n]; p != nil; p = p->nxtptr) - dump_one_def(p); - } + if ((p = lookup_macro_definition(argv[n])) != NULL) + dump_one_def(argv[n], p); + } else + macro_for_all(dump_one_def); } /* @@ -734,15 +709,10 @@ static int doincl(const char *ifile) { if (ilevel + 1 == MAXINP) - errx(1, "%s at line %lu: too many include files.", - CURRENT_NAME, CURRENT_LINE); + m4errx(1, "too many include files."); if (fopen_trypath(infile+ilevel+1, ifile) != NULL) { ilevel++; - if ((inname[ilevel] = strdup(ifile)) == NULL) - err(1, NULL); - inlineno[ilevel] = 1; bbase[ilevel] = bufbase = bp; - emitline(); return (1); } else return (0); @@ -760,97 +730,74 @@ dopaste(const char *pfile) int c; if ((pf = fopen(pfile, "r")) != NULL) { - fprintf(active, "#line 1 \"%s\"\n", pfile); + if (synch_lines) + fprintf(active, "#line 1 \"%s\"\n", pfile); while ((c = getc(pf)) != EOF) putc(c, active); (void) fclose(pf); - emitline(); + emit_synchline(); return (1); } else return (0); } #endif +/* + * dochq - change quote characters + */ static void -gnu_dochq(const char *argv[], int ac) +dochq(const char *argv[], int ac) { - /* In gnu-m4 mode, the only way to restore quotes is to have no - * arguments at all. */ if (ac == 2) { - lquote[0] = LQUOTE, lquote[1] = EOS; - rquote[0] = RQUOTE, rquote[1] = EOS; + lquote[0] = LQUOTE; lquote[1] = EOS; + rquote[0] = RQUOTE; rquote[1] = EOS; } else { strlcpy(lquote, argv[2], sizeof(lquote)); - if(ac > 3) + if (ac > 3) { strlcpy(rquote, argv[3], sizeof(rquote)); - else - rquote[0] = EOS; + } else { + rquote[0] = ECOMMT; rquote[1] = EOS; + } } } /* - * dochq - change quote characters + * dochc - change comment characters */ static void -dochq(const char *argv[], int argc) -{ - if (argc > 2) { - if (*argv[2]) - strlcpy(lquote, argv[2], sizeof(lquote)); - else { - lquote[0] = LQUOTE; - lquote[1] = EOS; - } - if (argc > 3) { - if (*argv[3]) - strlcpy(rquote, argv[3], sizeof(rquote)); - } else - strcpy(rquote, lquote); - } else { - lquote[0] = LQUOTE, lquote[1] = EOS; - rquote[0] = RQUOTE, rquote[1] = EOS; - } -} - -static void -gnu_dochc(const char *argv[], int ac) +dochc(const char *argv[], int argc) { - /* In gnu-m4 mode, no arguments mean no comment - * arguments at all. */ - if (ac == 2) { +/* XXX Note that there is no difference between no argument and a single + * empty argument. + */ + if (argc == 2) { scommt[0] = EOS; ecommt[0] = EOS; } else { - if (*argv[2]) - strlcpy(scommt, argv[2], sizeof(scommt)); - else - scommt[0] = SCOMMT, scommt[1] = EOS; - if(ac > 3 && *argv[3]) + strlcpy(scommt, argv[2], sizeof(scommt)); + if (argc == 3) { + ecommt[0] = ECOMMT; ecommt[1] = EOS; + } else { strlcpy(ecommt, argv[3], sizeof(ecommt)); - else - ecommt[0] = ECOMMT, ecommt[1] = EOS; + } } } + /* - * dochc - change comment characters + * dom4wrap - expand text at EOF */ static void -dochc(const char *argv[], int argc) +dom4wrap(const char *text) { - if (argc > 2) { - if (*argv[2]) - strlcpy(scommt, argv[2], sizeof(scommt)); - if (argc > 3) { - if (*argv[3]) - strlcpy(ecommt, argv[3], sizeof(ecommt)); - } + if (wrapindex >= maxwraps) { + if (maxwraps == 0) + maxwraps = 16; else - ecommt[0] = ECOMMT, ecommt[1] = EOS; - } - else { - scommt[0] = SCOMMT, scommt[1] = EOS; - ecommt[0] = ECOMMT, ecommt[1] = EOS; + maxwraps *= 2; + m4wraps = xrealloc(m4wraps, maxwraps * sizeof(*m4wraps), + "too many m4wraps"); } + m4wraps[wrapindex++] = xstrdup(text); } /* @@ -867,14 +814,14 @@ dodiv(int n) resizedivs(n + 10); else n = 0; /* bitbucket */ - } + } if (n < 0) n = 0; /* bitbucket */ if (outfile[n] == NULL) { char fname[] = _PATH_DIVNAME; - if ((fd = mkstemp(fname)) < 0 || + if ((fd = mkstemp(fname)) < 0 || (outfile[n] = fdopen(fd, "w+")) == NULL) err(1, "%s: cannot divert", fname); if (unlink(fname) == -1) @@ -895,10 +842,15 @@ doundiv(const char *argv[], int argc) if (argc > 2) { for (ind = 2; ind < argc; ind++) { - n = atoi(argv[ind]); - if (n > 0 && n < maxout && outfile[n] != NULL) - getdiv(n); - + const char *errstr; + n = strtonum(argv[ind], 1, INT_MAX, &errstr); + if (errstr) { + if (errno == EINVAL && mimic_gnu) + getdivfile(argv[ind]); + } else { + if (n < maxout && outfile[n] != NULL) + getdiv(n); + } } } else @@ -931,7 +883,7 @@ dosub(const char *argv[], int argc) #endif if (fc >= ap && fc < ap + strlen(ap)) for (k = fc + nc - 1; k >= fc; k--) - putback(*k); + pushback(*k); } /* @@ -939,25 +891,11 @@ dosub(const char *argv[], int argc) * map every character of s1 that is specified in from * into s3 and replace in s. (source s1 remains untouched) * - * This is a standard implementation of map(s,from,to) function of ICON - * language. Within mapvec, we replace every character of "from" with - * the corresponding character in "to". If "to" is shorter than "from", - * than the corresponding entries are null, which means that those - * characters dissapear altogether. Furthermore, imagine - * map(dest, "sourcestring", "srtin", "rn..*") type call. In this case, - * `s' maps to `r', `r' maps to `n' and `n' maps to `*'. Thus, `s' - * ultimately maps to `*'. In order to achieve this effect in an efficient - * manner (i.e. without multiple passes over the destination string), we - * loop over mapvec, starting with the initial source character. if the - * character value (dch) in this location is different than the source - * character (sch), sch becomes dch, once again to index into mapvec, until - * the character value stabilizes (i.e. sch = dch, in other words - * mapvec[n] == n). Even if the entry in the mapvec is null for an ordinary - * character, it will stabilize, since mapvec[0] == 0 at all times. At the - * end, we restore mapvec* back to normal where mapvec[n] == n for - * 0 <= n <= 127. This strategy, along with the restoration of mapvec, is - * about 5 times faster than any algorithm that makes multiple passes over - * destination string. + * This is derived from the a standard implementation of map(s,from,to) + * function of ICON language. Within mapvec, we replace every character + * of "from" with the corresponding character in "to". + * If "to" is shorter than "from", than the corresponding entries are null, + * which means that those characters dissapear altogether. */ static void map(char *dest, const char *src, const char *from, const char *to) @@ -966,6 +904,8 @@ map(char *dest, const char *src, const c unsigned char sch, dch; static char frombis[257]; static char tobis[257]; + int i; + char seen[256]; static unsigned char mapvec[256] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, @@ -1000,17 +940,21 @@ map(char *dest, const char *src, const c * create a mapping between "from" and * "to" */ - while (*from) - mapvec[(unsigned char)(*from++)] = (*to) ? - (unsigned char)(*to++) : 0; + for (i = 0; i < 256; i++) + seen[i] = 0; + while (*from) { + if (!seen[(unsigned char)(*from)]) { + mapvec[(unsigned char)(*from)] = (unsigned char)(*to); + seen[(unsigned char)(*from)] = 1; + } + from++; + if (*to) + to++; + } while (*src) { sch = (unsigned char)(*src++); dch = mapvec[sch]; - while (dch != sch) { - sch = dch; - dch = mapvec[sch]; - } if ((*dest = (char)dch)) dest++; } @@ -1040,12 +984,23 @@ handledash(char *buffer, char *end, cons while(*src) { if (src[1] == '-' && src[2]) { unsigned char i; - for (i = (unsigned char)src[0]; - i <= (unsigned char)src[2]; i++) { - *p++ = i; - if (p == end) { - *p = '\0'; - return buffer; + if ((unsigned char)src[0] <= (unsigned char)src[2]) { + for (i = (unsigned char)src[0]; + i <= (unsigned char)src[2]; i++) { + *p++ = i; + if (p == end) { + *p = '\0'; + return buffer; + } + } + } else { + for (i = (unsigned char)src[0]; + i >= (unsigned char)src[2]; i--) { + *p++ = i; + if (p == end) { + *p = '\0'; + return buffer; + } } } src += 3; Modified: stable/9/usr.bin/m4/expr.c ============================================================================== --- stable/9/usr.bin/m4/expr.c Thu Dec 12 14:49:26 2013 (r259261) +++ stable/9/usr.bin/m4/expr.c Thu Dec 12 15:04:59 2013 (r259262) @@ -1,641 +1,47 @@ -/* $OpenBSD: expr.c,v 1.14 2002/04/26 16:15:16 espie Exp $ */ -/* $NetBSD: expr.c,v 1.7 1995/09/28 05:37:31 tls Exp $ */ - +/* $OpenBSD: expr.c,v 1.18 2010/09/07 19:58:09 marco Exp $ */ /* - * Copyright (c) 1989, 1993 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Ozan Yigit at York University. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. + * Copyright (c) 2004 Marc Espie * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ - -#ifndef lint -#if 0 -static char sccsid[] = "@(#)expr.c 8.2 (Berkeley) 4/29/95"; -#else -#if 0 -static char rcsid[] = "$OpenBSD: expr.c,v 1.14 2002/04/26 16:15:16 espie Exp $"; -#endif -#endif -#endif /* not lint */ - #include __FBSDID("$FreeBSD$"); -#include -#include -#include -#include +#include #include +#include #include "mdef.h" #include "extern.h" -/* - * expression evaluator: performs a standard recursive - * descent parse to evaluate any expression permissible - * within the following grammar: - * - * expr : query EOS - * query : lor - * | lor "?" query ":" query - * lor : land { "||" land } - * land : bor { "&&" bor } - * bor : xor { "|" xor } - * xor : band { "^" eqrel } - * band : eqrel { "&" eqrel } - * eqrel : nerel { ("==" | "!=") nerel } - * nerel : shift { ("<" | ">" | "<=" | ">=") shift } - * shift : primary { ("<<" | ">>") primary } - * primary : term { ("+" | "-") term } - * term : exp { ("*" | "/" | "%") exp } - * exp : unary { "**" unary } - * unary : factor - * | ("+" | "-" | "~" | "!") unary - * factor : constant *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-9@FreeBSD.ORG Thu Dec 12 18:16:50 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B1318F5A; Thu, 12 Dec 2013 18:16:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9B13119FC; Thu, 12 Dec 2013 18:16:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBCIGoTw022301; Thu, 12 Dec 2013 18:16:50 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBCIGlhG022281; Thu, 12 Dec 2013 18:16:47 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201312121816.rBCIGlhG022281@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Thu, 12 Dec 2013 18:16:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r259269 - in stable/9/contrib: gcc gcc/config/rs6000 gcc/cp gcc/doc gcclibs/libcpp X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Dec 2013 18:16:50 -0000 Author: pfg Date: Thu Dec 12 18:16:46 2013 New Revision: 259269 URL: http://svnweb.freebsd.org/changeset/base/259269 Log: MFC r258081, r258138, r258143, r258179, r258157, r258204, 258205, r258206, r258207, r258321 This is a series of commits inspired on Google's gcc-4.2.1 for Android that were taken from the gcc pre-4.3 under the GPLv2. gcc: Backport fixes for -W parentheses in C++ This fixes GCC 19564. gcc: merge rs6000 change from FSF pre-gcc43 Don't set MASK_PPC_GFXOPT for 8540 or 8548. Merge vrp-tree fix from gcc-4.3 Fix missed conversion from / to >> (GCC PR32521) Merge in GCCr120505 to include definition of TREE_OVERFLOW_P gcc: warn about integer overflow in constant expressions in the C++ frontend. gcc: Add a new option -Wvla to warn variable length array. libcpp: preprocessor speedup patches from upstream gcc. gcc: add femit-struct-debug support to reduce Reduce dwarf debug size gcc: Fix postreload-gcse treatment of call-clobbered registers. gcc: Record some previous commits in the ChangeLog.gcc43 file. Modified: stable/9/contrib/gcc/ChangeLog.gcc43 stable/9/contrib/gcc/c-common.c stable/9/contrib/gcc/c-common.h stable/9/contrib/gcc/c-decl.c stable/9/contrib/gcc/c-opts.c stable/9/contrib/gcc/c-typeck.c stable/9/contrib/gcc/c.opt stable/9/contrib/gcc/config/rs6000/rs6000.c stable/9/contrib/gcc/cp/cp-lang.c stable/9/contrib/gcc/cp/cp-tree.h stable/9/contrib/gcc/cp/decl.c stable/9/contrib/gcc/cp/parser.c stable/9/contrib/gcc/cp/pt.c stable/9/contrib/gcc/cp/semantics.c stable/9/contrib/gcc/cp/tree.c stable/9/contrib/gcc/cp/typeck.c stable/9/contrib/gcc/doc/invoke.texi stable/9/contrib/gcc/dwarf2out.c stable/9/contrib/gcc/flags.h stable/9/contrib/gcc/langhooks-def.h stable/9/contrib/gcc/langhooks.h stable/9/contrib/gcc/opts.c stable/9/contrib/gcc/postreload-gcse.c stable/9/contrib/gcc/regs.h stable/9/contrib/gcc/rtlanal.c stable/9/contrib/gcc/tree-vrp.c stable/9/contrib/gcc/tree.h stable/9/contrib/gcclibs/libcpp/files.c stable/9/contrib/gcclibs/libcpp/internal.h stable/9/contrib/gcclibs/libcpp/lex.c Directory Properties: stable/9/ (props changed) stable/9/contrib/gcc/ (props changed) stable/9/contrib/gcclibs/ (props changed) Modified: stable/9/contrib/gcc/ChangeLog.gcc43 ============================================================================== --- stable/9/contrib/gcc/ChangeLog.gcc43 Thu Dec 12 18:15:32 2013 (r259268) +++ stable/9/contrib/gcc/ChangeLog.gcc43 Thu Dec 12 18:16:46 2013 (r259269) @@ -1,9 +1,35 @@ -2007-06-05 Joerg Wunsch (r23479) +2007-08-08 Andrew Haley (r128087) + + * config/arm/libunwind.S (UNWIND_WRAPPER _Unwind_Backtrace): New. + * config/arm/unwind-arm.h (__gnu_Unwind_Backtrace): New. + * config/arm/unwind-arm.c (__gnu_Unwind_Backtrace): New. + +2007-06-05 Joerg Wunsch (r125346) PR preprocessor/23479 * doc/extend.texi: Document the 0b-prefixed binary integer constant extension. +2007-05-24 Richard Sandiford (r125037) + + * postreload-gcse.c (reg_changed_after_insn_p): New function. + (oprs_unchanged_p): Use it to check all registers in a REG. + (record_opr_changes): Look for clobbers in CALL_INSN_FUNCTION_USAGE. + (reg_set_between_after_reload_p): Delete. + (reg_used_between_after_reload_p): Likewise. + (reg_set_or_used_since_bb_start): Likewise. + (eliminate_partially_redundant_load): Use reg_changed_after_insn_p + and reg_used_between_p instead of reg_set_or_used_since_bb_start. + Use reg_set_between_p instead of reg_set_between_after_reload_p. + * rtlanal.c (reg_set_p): Check whether REG overlaps + regs_invalidated_by_call, rather than just checking the + membership of REGNO (REG). + +2007-05-03 Ian Lance Taylor (r124381) + + * config/rs6000/rs6000.c (rs6000_override_options): Don't set + MASK_PPC_GFXOPT for 8540 or 8548. + 2007-05-01 Dwarakanath Rajagopal (r124341) * doc/invoke.texi: Fix typo, 'AMD Family 10h core' instead of @@ -22,6 +48,57 @@ alignment for amdfam10 architecture. Increasing the max loop alignment to 24 bytes. +2007-04-16 Lawrence Crowl + + * doc/invoke.texi (Debugging Options): Add documentation for the + -femit-struct-debug options -femit-struct-debug-baseonly, + -femit-struct-debug-reduced, and + -femit-struct-debug-detailed[=...]. + + * c-opts.c (c_common_handle_option): Add + OPT_femit_struct_debug_baseonly, OPT_femit_struct_debug_reduced, + and OPT_femit_struct_debug_detailed_. + * c.opt: Add specifications for + -femit-struct-debug-baseonly, -femit-struct-debug-reduced, + and -femit-struct-debug-detailed[=...]. + * opts.c (set_struct_debug_option): Parse the + -femit-struct-debug-... options. + * opts.c (matches_main_base, main_input_basename, + main_input_baselength, base_of_path, matches_main_base): Add + variables and functions to compare header base name to compilation + unit base name. + * opts.c (should_emit_struct_debug): Add to determine to emit a + structure based on the option. + (dump_struct_debug) Also disabled function to debug this + function. + * opts.c (handle_options): Save the base name of the + compilation unit. + + * langhooks-def.h (LANG_HOOKS_GENERIC_TYPE_P): Define. + (LANG_HOOKS_FOR_TYPES_INITIALIZER): Add. + This hook indicates if a type is generic. Set it by default + to "never generic". + * langhooks.h (struct lang_hooks_for_types): Add a new hook + to determine if a struct type is generic or not. + * cp/cp-tree.h (class_tmpl_impl_spec_p): Declare a C++ hook. + * cp/tree.c (class_tmpl_impl_spec_p): Implement the C++ hook. + * cp/cp-lang.c (LANG_HOOKS_GENERIC_TYPE_P): Override null C hook + with live C++ hook. + + * flags.h (enum debug_info_usage): Add an enumeration to describe + a program's use of a structure type. + * dwarf2out.c (gen_struct_or_union_type_die): Add a new parameter + to indicate the program's usage of the type. Filter structs based + on the -femit-struct-debug-... specification. + (gen_type_die): Split into two routines, gen_type_die and + gen_type_die_with_usage. gen_type_die is now a wrapper + that assumes direct usage. + (gen_type_die_with_usage): Replace calls to gen_type_die + with gen_type_die_with_usage adding the program usage of + the referenced type. + (dwarf2out_imported_module_or_decl): Suppress struct debug + information using should_emit_struct_debug when appropriate. + 2007-04-12 Richard Guenther (r123736) PR tree-optimization/24689 @@ -44,6 +121,19 @@ * config/i386/i386.c (override_options): Likewise. * doc/invoke.texi: Likewise. +2007-03-12 Seongbae Park + + * c-decl.c (warn_variable_length_array): New function. + Refactored from grokdeclarator to handle warn_vla + and handle unnamed array case. + (grokdeclarator): Refactored VLA warning case. + * c.opt (Wvla): New flag. + +2007-03-11 Ian Lance Taylor (r122831 - partial) + + * tree-vrp.c (vrp_int_const_binop): Handle PLUS_EXPR and + the *_DIV_EXPR codes correctly with overflow infinities. + 2007-02-09 Dwarakanath Rajagopal (r121763) * config/i386/driver-i386.c: Turn on -mtune=native for AMDFAM10. @@ -232,6 +322,17 @@ * config.gcc: Support core2 processor. +2006-12-13 Ian Lance Taylor (r119855) + + PR c++/19564 + PR c++/19756 + * c-typeck.c (parser_build_binary_op): Move parentheses warnings + to warn_about_parentheses in c-common.c. + * c-common.c (warn_about_parentheses): New function. + * c-common.h (warn_about_parentheses): Declare. + * doc/invoke.texi (Warning Options): Update -Wparentheses + description. + 2006-12-02 H.J. Lu (r119454 - partial) PR target/30040 @@ -270,6 +371,35 @@ (override_options): Add entries for Core2. (ix86_issue_rate): Add case for Core2. +2006-10-31 Geoffrey Keating (r118356) + + * c-decl.c (grokdeclarator): Don't set DECL_EXTERNAL on + inline static functions in c99 mode. + + PR 16622 + * doc/extend.texi (Inline): Update. + * c-tree.h (struct language_function): Remove field 'extern_inline'. + * c-decl.c (current_extern_inline): Delete. + (pop_scope): Adjust test for an undefined nested function. + Add warning about undeclared inline function. + (diagnose_mismatched_decls): Update comments. Disallow overriding + of inline functions in a translation unit in C99. Allow inline + declarations in C99 at any time. + (merge_decls): Boolize variables. Handle C99 'extern inline' + semantics. + (grokdeclarator): Set DECL_EXTERNAL here for functions. Handle + C99 inline semantics. + (start_function): Don't clear current_extern_inline. Don't set + DECL_EXTERNAL. + (c_push_function_context): Don't push current_extern_inline. + (c_pop_function_context): Don't restore current_extern_inline. + + PR 11377 + * c-typeck.c (build_external_ref): Warn about static variables + used in extern inline functions. + * c-decl.c (start_decl): Warn about static variables declared + in extern inline functions. + 2006-10-27 Vladimir Makarov (r118090) * config/i386/i386.h (TARGET_GEODE): Modified: stable/9/contrib/gcc/c-common.c ============================================================================== --- stable/9/contrib/gcc/c-common.c Thu Dec 12 18:15:32 2013 (r259268) +++ stable/9/contrib/gcc/c-common.c Thu Dec 12 18:16:46 2013 (r259269) @@ -2585,9 +2585,13 @@ c_common_truthvalue_conversion (tree exp break; case MODIFY_EXPR: - if (!TREE_NO_WARNING (expr)) - warning (OPT_Wparentheses, - "suggest parentheses around assignment used as truth value"); + if (!TREE_NO_WARNING (expr) + && warn_parentheses) + { + warning (OPT_Wparentheses, + "suggest parentheses around assignment used as truth value"); + TREE_NO_WARNING (expr) = 1; + } break; default: @@ -6471,5 +6475,87 @@ warn_array_subscript_with_type_char (tre warning (OPT_Wchar_subscripts, "array subscript has type %"); } +/* Implement -Wparentheses for the unexpected C precedence rules, to + cover cases like x + y << z which readers are likely to + misinterpret. We have seen an expression in which CODE is a binary + operator used to combine expressions headed by CODE_LEFT and + CODE_RIGHT. CODE_LEFT and CODE_RIGHT may be ERROR_MARK, which + means that that side of the expression was not formed using a + binary operator, or it was enclosed in parentheses. */ + +void +warn_about_parentheses (enum tree_code code, enum tree_code code_left, + enum tree_code code_right) +{ + if (!warn_parentheses) + return; + + if (code == LSHIFT_EXPR || code == RSHIFT_EXPR) + { + if (code_left == PLUS_EXPR || code_left == MINUS_EXPR + || code_right == PLUS_EXPR || code_right == MINUS_EXPR) + warning (OPT_Wparentheses, + "suggest parentheses around + or - inside shift"); + } + + if (code == TRUTH_ORIF_EXPR) + { + if (code_left == TRUTH_ANDIF_EXPR + || code_right == TRUTH_ANDIF_EXPR) + warning (OPT_Wparentheses, + "suggest parentheses around && within ||"); + } + + if (code == BIT_IOR_EXPR) + { + if (code_left == BIT_AND_EXPR || code_left == BIT_XOR_EXPR + || code_left == PLUS_EXPR || code_left == MINUS_EXPR + || code_right == BIT_AND_EXPR || code_right == BIT_XOR_EXPR + || code_right == PLUS_EXPR || code_right == MINUS_EXPR) + warning (OPT_Wparentheses, + "suggest parentheses around arithmetic in operand of |"); + /* Check cases like x|y==z */ + if (TREE_CODE_CLASS (code_left) == tcc_comparison + || TREE_CODE_CLASS (code_right) == tcc_comparison) + warning (OPT_Wparentheses, + "suggest parentheses around comparison in operand of |"); + } + + if (code == BIT_XOR_EXPR) + { + if (code_left == BIT_AND_EXPR + || code_left == PLUS_EXPR || code_left == MINUS_EXPR + || code_right == BIT_AND_EXPR + || code_right == PLUS_EXPR || code_right == MINUS_EXPR) + warning (OPT_Wparentheses, + "suggest parentheses around arithmetic in operand of ^"); + /* Check cases like x^y==z */ + if (TREE_CODE_CLASS (code_left) == tcc_comparison + || TREE_CODE_CLASS (code_right) == tcc_comparison) + warning (OPT_Wparentheses, + "suggest parentheses around comparison in operand of ^"); + } + + if (code == BIT_AND_EXPR) + { + if (code_left == PLUS_EXPR || code_left == MINUS_EXPR + || code_right == PLUS_EXPR || code_right == MINUS_EXPR) + warning (OPT_Wparentheses, + "suggest parentheses around + or - in operand of &"); + /* Check cases like x&y==z */ + if (TREE_CODE_CLASS (code_left) == tcc_comparison + || TREE_CODE_CLASS (code_right) == tcc_comparison) + warning (OPT_Wparentheses, + "suggest parentheses around comparison in operand of &"); + } + + /* Similarly, check for cases like 1<=i<=10 that are probably errors. */ + if (TREE_CODE_CLASS (code) == tcc_comparison + && (TREE_CODE_CLASS (code_left) == tcc_comparison + || TREE_CODE_CLASS (code_right) == tcc_comparison)) + warning (OPT_Wparentheses, "comparisons like X<=Y<=Z do not " + "have their mathematical meaning"); +} + #include "gt-c-common.h" Modified: stable/9/contrib/gcc/c-common.h ============================================================================== --- stable/9/contrib/gcc/c-common.h Thu Dec 12 18:15:32 2013 (r259268) +++ stable/9/contrib/gcc/c-common.h Thu Dec 12 18:16:46 2013 (r259269) @@ -850,6 +850,9 @@ extern int complete_array_type (tree *, extern tree builtin_type_for_size (int, bool); extern void warn_array_subscript_with_type_char (tree); +extern void warn_about_parentheses (enum tree_code, enum tree_code, + enum tree_code); + /* In c-gimplify.c */ extern void c_genericize (tree); Modified: stable/9/contrib/gcc/c-decl.c ============================================================================== --- stable/9/contrib/gcc/c-decl.c Thu Dec 12 18:15:32 2013 (r259268) +++ stable/9/contrib/gcc/c-decl.c Thu Dec 12 18:16:46 2013 (r259269) @@ -3931,6 +3931,61 @@ check_bitfield_type_and_width (tree *typ } + +/* Print warning about variable length array if necessary. */ + +static void +warn_variable_length_array (const char *name, tree size) +{ + int ped = !flag_isoc99 && pedantic && warn_vla != 0; + int const_size = TREE_CONSTANT (size); + + if (ped) + { + if (const_size) + { + if (name) + pedwarn ("ISO C90 forbids array %qs whose size " + "can%'t be evaluated", + name); + else + pedwarn ("ISO C90 forbids array whose size " + "can%'t be evaluated"); + } + else + { + if (name) + pedwarn ("ISO C90 forbids variable length array %qs", + name); + else + pedwarn ("ISO C90 forbids variable length array"); + } + } + else if (warn_vla > 0) + { + if (const_size) + { + if (name) + warning (OPT_Wvla, + "the size of array %qs can" + "%'t be evaluated", name); + else + warning (OPT_Wvla, + "the size of array can %'t be evaluated"); + } + else + { + if (name) + warning (OPT_Wvla, + "variable length array %qs is used", + name); + else + warning (OPT_Wvla, + "variable length array is used"); + } + } +} + /* Given declspecs and a declarator, determine the name and type of the object declared and construct a ..._DECL node for it. @@ -4329,17 +4384,7 @@ grokdeclarator (const struct c_declarato nonconstant even if it is (eg) a const variable with known value. */ size_varies = 1; - - if (!flag_isoc99 && pedantic) - { - if (TREE_CONSTANT (size)) - pedwarn ("ISO C90 forbids array %qs whose size " - "can%'t be evaluated", - name); - else - pedwarn ("ISO C90 forbids variable-size array %qs", - name); - } + warn_variable_length_array (orig_name, size); if (warn_variable_decl) warning (0, "variable-sized array %qs", name); } Modified: stable/9/contrib/gcc/c-opts.c ============================================================================== --- stable/9/contrib/gcc/c-opts.c Thu Dec 12 18:15:32 2013 (r259268) +++ stable/9/contrib/gcc/c-opts.c Thu Dec 12 18:16:46 2013 (r259269) @@ -818,6 +818,18 @@ c_common_handle_option (size_t scode, co flag_gen_declaration = 1; break; + case OPT_femit_struct_debug_baseonly: + set_struct_debug_option ("base"); + break; + + case OPT_femit_struct_debug_reduced: + set_struct_debug_option ("dir:ord:sys,dir:gen:any,ind:base"); + break; + + case OPT_femit_struct_debug_detailed_: + set_struct_debug_option (arg); + break; + case OPT_idirafter: add_path (xstrdup (arg), AFTER, 0, true); break; Modified: stable/9/contrib/gcc/c-typeck.c ============================================================================== --- stable/9/contrib/gcc/c-typeck.c Thu Dec 12 18:15:32 2013 (r259268) +++ stable/9/contrib/gcc/c-typeck.c Thu Dec 12 18:16:46 2013 (r259269) @@ -2631,73 +2631,7 @@ parser_build_binary_op (enum tree_code c /* Check for cases such as x+y< Detailed reduced debug info for structs + idirafter C ObjC C++ ObjC++ Joined Separate -idirafter Add to the end of the system include path Modified: stable/9/contrib/gcc/config/rs6000/rs6000.c ============================================================================== --- stable/9/contrib/gcc/config/rs6000/rs6000.c Thu Dec 12 18:15:32 2013 (r259268) +++ stable/9/contrib/gcc/config/rs6000/rs6000.c Thu Dec 12 18:16:46 2013 (r259269) @@ -1171,11 +1171,9 @@ rs6000_override_options (const char *def {"801", PROCESSOR_MPCCORE, POWERPC_BASE_MASK | MASK_SOFT_FLOAT}, {"821", PROCESSOR_MPCCORE, POWERPC_BASE_MASK | MASK_SOFT_FLOAT}, {"823", PROCESSOR_MPCCORE, POWERPC_BASE_MASK | MASK_SOFT_FLOAT}, - {"8540", PROCESSOR_PPC8540, - POWERPC_BASE_MASK | MASK_PPC_GFXOPT | MASK_STRICT_ALIGN}, + {"8540", PROCESSOR_PPC8540, POWERPC_BASE_MASK | MASK_STRICT_ALIGN}, /* 8548 has a dummy entry for now. */ - {"8548", PROCESSOR_PPC8540, - POWERPC_BASE_MASK | MASK_PPC_GFXOPT | MASK_STRICT_ALIGN}, + {"8548", PROCESSOR_PPC8540, POWERPC_BASE_MASK | MASK_STRICT_ALIGN}, {"860", PROCESSOR_MPCCORE, POWERPC_BASE_MASK | MASK_SOFT_FLOAT}, {"970", PROCESSOR_POWER4, POWERPC_7400_MASK | MASK_PPC_GPOPT | MASK_MFCRF | MASK_POWERPC64}, Modified: stable/9/contrib/gcc/cp/cp-lang.c ============================================================================== --- stable/9/contrib/gcc/cp/cp-lang.c Thu Dec 12 18:15:32 2013 (r259268) +++ stable/9/contrib/gcc/cp/cp-lang.c Thu Dec 12 18:16:46 2013 (r259269) @@ -44,6 +44,8 @@ static void cp_init_ts (void); #define LANG_HOOKS_NAME "GNU C++" #undef LANG_HOOKS_INIT #define LANG_HOOKS_INIT cxx_init +#undef LANG_HOOKS_GENERIC_TYPE_P +#define LANG_HOOKS_GENERIC_TYPE_P class_tmpl_impl_spec_p #undef LANG_HOOKS_DECL_PRINTABLE_NAME #define LANG_HOOKS_DECL_PRINTABLE_NAME cxx_printable_name #undef LANG_HOOKS_FOLD_OBJ_TYPE_REF Modified: stable/9/contrib/gcc/cp/cp-tree.h ============================================================================== --- stable/9/contrib/gcc/cp/cp-tree.h Thu Dec 12 18:15:32 2013 (r259268) +++ stable/9/contrib/gcc/cp/cp-tree.h Thu Dec 12 18:16:46 2013 (r259269) @@ -4373,6 +4373,7 @@ extern tree add_stmt_to_compound (tree, extern tree cxx_maybe_build_cleanup (tree); extern void init_tree (void); extern int pod_type_p (tree); +extern bool class_tmpl_impl_spec_p (tree); extern int zero_init_p (tree); extern tree canonical_type_variant (tree); extern tree copy_binfo (tree, tree, tree, @@ -4460,8 +4461,9 @@ extern tree build_x_indirect_ref (tree, extern tree build_indirect_ref (tree, const char *); extern tree build_array_ref (tree, tree); extern tree get_member_function_from_ptrfunc (tree *, tree); -extern tree build_x_binary_op (enum tree_code, tree, tree, - bool *); +extern tree build_x_binary_op (enum tree_code, tree, + enum tree_code, tree, + enum tree_code, bool *); extern tree build_x_unary_op (enum tree_code, tree); extern tree unary_complex_lvalue (enum tree_code, tree); extern tree build_x_conditional_expr (tree, tree, tree); Modified: stable/9/contrib/gcc/cp/decl.c ============================================================================== --- stable/9/contrib/gcc/cp/decl.c Thu Dec 12 18:15:32 2013 (r259268) +++ stable/9/contrib/gcc/cp/decl.c Thu Dec 12 18:16:46 2013 (r259269) @@ -6702,12 +6702,21 @@ compute_array_index_type (tree name, tre error ("size of array is not an integral constant-expression"); size = integer_one_node; } - else if (pedantic) + else if (pedantic && warn_vla != 0) { if (name) - pedwarn ("ISO C++ forbids variable-size array %qD", name); + pedwarn ("ISO C++ forbids variable length array %qD", name); else - pedwarn ("ISO C++ forbids variable-size array"); + pedwarn ("ISO C++ forbids variable length array"); + } + else if (warn_vla > 0) + { + if (name) + warning (OPT_Wvla, + "variable length array %qD is used", name); + else + warning (OPT_Wvla, + "variable length array is used"); } if (processing_template_decl && !TREE_CONSTANT (size)) Modified: stable/9/contrib/gcc/cp/parser.c ============================================================================== --- stable/9/contrib/gcc/cp/parser.c Thu Dec 12 18:15:32 2013 (r259268) +++ stable/9/contrib/gcc/cp/parser.c Thu Dec 12 18:16:46 2013 (r259269) @@ -1177,8 +1177,15 @@ typedef enum cp_parser_status_kind typedef struct cp_parser_expression_stack_entry { + /* Left hand side of the binary operation we are currently + parsing. */ tree lhs; + /* Original tree code for left hand side, if it was a binary + expression itself (used for -Wparentheses). */ + enum tree_code lhs_type; + /* Tree code for the binary operation we are parsing. */ enum tree_code tree_type; + /* Precedence of the binary operation we are parsing. */ int prec; } cp_parser_expression_stack_entry; @@ -1536,7 +1543,7 @@ static tree cp_parser_builtin_offsetof /* Statements [gram.stmt.stmt] */ static void cp_parser_statement - (cp_parser *, tree, bool); + (cp_parser *, tree, bool, bool *); static void cp_parser_label_for_labeled_statement (cp_parser *); static tree cp_parser_expression_statement @@ -1546,7 +1553,7 @@ static tree cp_parser_compound_statement static void cp_parser_statement_seq_opt (cp_parser *, tree); static tree cp_parser_selection_statement - (cp_parser *); + (cp_parser *, bool *); static tree cp_parser_condition (cp_parser *); static tree cp_parser_iteration_statement @@ -1559,7 +1566,7 @@ static void cp_parser_declaration_statem (cp_parser *); static tree cp_parser_implicitly_scoped_statement - (cp_parser *); + (cp_parser *, bool *); static void cp_parser_already_scoped_statement (cp_parser *); @@ -5730,12 +5737,13 @@ cp_parser_binary_expression (cp_parser* cp_parser_expression_stack_entry *sp = &stack[0]; tree lhs, rhs; cp_token *token; - enum tree_code tree_type; + enum tree_code tree_type, lhs_type, rhs_type; enum cp_parser_prec prec = PREC_NOT_OPERATOR, new_prec, lookahead_prec; bool overloaded_p; /* Parse the first expression. */ lhs = cp_parser_cast_expression (parser, /*address_p=*/false, cast_p); + lhs_type = ERROR_MARK; for (;;) { @@ -5768,6 +5776,7 @@ cp_parser_binary_expression (cp_parser* /* Extract another operand. It may be the RHS of this expression or the LHS of a new, higher priority expression. */ rhs = cp_parser_simple_cast_expression (parser); + rhs_type = ERROR_MARK; /* Get another operator token. Look up its precedence to avoid building a useless (immediately popped) stack entry for common @@ -5783,8 +5792,10 @@ cp_parser_binary_expression (cp_parser* sp->prec = prec; sp->tree_type = tree_type; sp->lhs = lhs; + sp->lhs_type = lhs_type; sp++; lhs = rhs; + lhs_type = rhs_type; prec = new_prec; new_prec = lookahead_prec; goto get_rhs; @@ -5801,11 +5812,15 @@ cp_parser_binary_expression (cp_parser* prec = sp->prec; tree_type = sp->tree_type; rhs = lhs; + rhs_type = lhs_type; lhs = sp->lhs; + lhs_type = sp->lhs_type; } overloaded_p = false; - lhs = build_x_binary_op (tree_type, lhs, rhs, &overloaded_p); + lhs = build_x_binary_op (tree_type, lhs, lhs_type, rhs, rhs_type, + &overloaded_p); + lhs_type = tree_type; /* If the binary operator required the use of an overloaded operator, then this expression cannot be an integral constant-expression. @@ -6222,17 +6237,23 @@ cp_parser_builtin_offsetof (cp_parser *p try-block IN_COMPOUND is true when the statement is nested inside a - cp_parser_compound_statement; this matters for certain pragmas. */ + cp_parser_compound_statement; this matters for certain pragmas. + + If IF_P is not NULL, *IF_P is set to indicate whether the statement + is a (possibly labeled) if statement which is not enclosed in braces + and has an else clause. This is used to implement -Wparentheses. */ static void cp_parser_statement (cp_parser* parser, tree in_statement_expr, - bool in_compound) + bool in_compound, bool *if_p) { tree statement; cp_token *token; location_t statement_location; restart: + if (if_p != NULL) + *if_p = false; /* There is no statement yet. */ statement = NULL_TREE; /* Peek at the next token. */ @@ -6257,7 +6278,7 @@ cp_parser_statement (cp_parser* parser, case RID_IF: case RID_SWITCH: - statement = cp_parser_selection_statement (parser); + statement = cp_parser_selection_statement (parser, if_p); break; case RID_WHILE: @@ -6522,7 +6543,7 @@ cp_parser_statement_seq_opt (cp_parser* break; /* Parse the statement. */ - cp_parser_statement (parser, in_statement_expr, true); + cp_parser_statement (parser, in_statement_expr, true, NULL); } } @@ -6533,14 +6554,22 @@ cp_parser_statement_seq_opt (cp_parser* if ( condition ) statement else statement switch ( condition ) statement - Returns the new IF_STMT or SWITCH_STMT. */ + Returns the new IF_STMT or SWITCH_STMT. + + If IF_P is not NULL, *IF_P is set to indicate whether the statement + is a (possibly labeled) if statement which is not enclosed in + braces and has an else clause. This is used to implement + -Wparentheses. */ static tree -cp_parser_selection_statement (cp_parser* parser) +cp_parser_selection_statement (cp_parser* parser, bool *if_p) { cp_token *token; enum rid keyword; + if (if_p != NULL) + *if_p = false; + /* Peek at the next token. */ token = cp_parser_require (parser, CPP_KEYWORD, "selection-statement"); @@ -6576,11 +6605,13 @@ cp_parser_selection_statement (cp_parser if (keyword == RID_IF) { + bool nested_if; + /* Add the condition. */ finish_if_stmt_cond (condition, statement); /* Parse the then-clause. */ - cp_parser_implicitly_scoped_statement (parser); + cp_parser_implicitly_scoped_statement (parser, &nested_if); finish_then_clause (statement); /* If the next token is `else', parse the else-clause. */ @@ -6591,8 +6622,28 @@ cp_parser_selection_statement (cp_parser cp_lexer_consume_token (parser->lexer); begin_else_clause (statement); /* Parse the else-clause. */ - cp_parser_implicitly_scoped_statement (parser); + cp_parser_implicitly_scoped_statement (parser, NULL); finish_else_clause (statement); + + /* If we are currently parsing a then-clause, then + IF_P will not be NULL. We set it to true to + indicate that this if statement has an else clause. + This may trigger the Wparentheses warning below + when we get back up to the parent if statement. */ + if (if_p != NULL) + *if_p = true; + } + else + { + /* This if statement does not have an else clause. If + NESTED_IF is true, then the then-clause is an if + statement which does have an else clause. We warn + about the potential ambiguity. */ + if (nested_if) + warning (OPT_Wparentheses, + ("%Hsuggest explicit braces " + "to avoid ambiguous %"), + EXPR_LOCUS (statement)); } /* Now we're all done with the if-statement. */ @@ -6611,7 +6662,7 @@ cp_parser_selection_statement (cp_parser in_statement = parser->in_statement; parser->in_switch_statement_p = true; parser->in_statement |= IN_SWITCH_STMT; - cp_parser_implicitly_scoped_statement (parser); + cp_parser_implicitly_scoped_statement (parser, NULL); parser->in_switch_statement_p = in_switch_statement_p; parser->in_statement = in_statement; @@ -6789,7 +6840,7 @@ cp_parser_iteration_statement (cp_parser statement = begin_do_stmt (); /* Parse the body of the do-statement. */ parser->in_statement = IN_ITERATION_STMT; - cp_parser_implicitly_scoped_statement (parser); + cp_parser_implicitly_scoped_statement (parser, NULL); parser->in_statement = in_statement; finish_do_body (statement); /* Look for the `while' keyword. */ @@ -7031,13 +7082,21 @@ cp_parser_declaration_statement (cp_pars but ensures that is in its own scope, even if it is not a compound-statement. + If IF_P is not NULL, *IF_P is set to indicate whether the statement + is a (possibly labeled) if statement which is not enclosed in + braces and has an else clause. This is used to implement + -Wparentheses. + Returns the new statement. */ static tree -cp_parser_implicitly_scoped_statement (cp_parser* parser) +cp_parser_implicitly_scoped_statement (cp_parser* parser, bool *if_p) { tree statement; + if (if_p != NULL) + *if_p = false; + /* Mark if () ; with a special NOP_EXPR. */ if (cp_lexer_next_token_is (parser->lexer, CPP_SEMICOLON)) { @@ -7053,7 +7112,7 @@ cp_parser_implicitly_scoped_statement (c /* Create a compound-statement. */ statement = begin_compound_stmt (0); /* Parse the dependent-statement. */ - cp_parser_statement (parser, NULL_TREE, false); + cp_parser_statement (parser, NULL_TREE, false, if_p); /* Finish the dummy compound-statement. */ finish_compound_stmt (statement); } @@ -7072,7 +7131,7 @@ cp_parser_already_scoped_statement (cp_p { /* If the token is a `{', then we must take special action. */ if (cp_lexer_next_token_is_not (parser->lexer, CPP_OPEN_BRACE)) - cp_parser_statement (parser, NULL_TREE, false); + cp_parser_statement (parser, NULL_TREE, false, NULL); else { /* Avoid calling cp_parser_compound_statement, so that we @@ -18645,7 +18704,7 @@ cp_parser_omp_structured_block (cp_parse tree stmt = begin_omp_structured_block (); unsigned int save = cp_parser_begin_omp_structured_block (parser); - cp_parser_statement (parser, NULL_TREE, false); + cp_parser_statement (parser, NULL_TREE, false, NULL); cp_parser_end_omp_structured_block (parser, save); return finish_omp_structured_block (stmt); @@ -18890,7 +18949,7 @@ cp_parser_omp_for_loop (cp_parser *parse /* Note that the grammar doesn't call for a structured block here, though the loop as a whole is a structured block. */ body = push_stmt_list (); - cp_parser_statement (parser, NULL_TREE, false); + cp_parser_statement (parser, NULL_TREE, false, NULL); body = pop_stmt_list (body); return finish_omp_for (loc, decl, init, cond, incr, body, pre_body); @@ -18983,7 +19042,7 @@ cp_parser_omp_sections_scope (cp_parser while (1) { - cp_parser_statement (parser, NULL_TREE, false); + cp_parser_statement (parser, NULL_TREE, false, NULL); tok = cp_lexer_peek_token (parser->lexer); if (tok->pragma_kind == PRAGMA_OMP_SECTION) Modified: stable/9/contrib/gcc/cp/pt.c ============================================================================== --- stable/9/contrib/gcc/cp/pt.c Thu Dec 12 18:15:32 2013 (r259268) +++ stable/9/contrib/gcc/cp/pt.c Thu Dec 12 18:16:46 2013 (r259269) @@ -9078,7 +9078,13 @@ tsubst_copy_and_build (tree t, return build_x_binary_op (TREE_CODE (t), RECUR (TREE_OPERAND (t, 0)), + (TREE_NO_WARNING (TREE_OPERAND (t, 0)) + ? ERROR_MARK + : TREE_CODE (TREE_OPERAND (t, 0))), RECUR (TREE_OPERAND (t, 1)), + (TREE_NO_WARNING (TREE_OPERAND (t, 1)) + ? ERROR_MARK + : TREE_CODE (TREE_OPERAND (t, 1))), /*overloaded_p=*/NULL); case SCOPE_REF: @@ -9087,7 +9093,14 @@ tsubst_copy_and_build (tree t, case ARRAY_REF: op1 = tsubst_non_call_postfix_expression (TREE_OPERAND (t, 0), args, complain, in_decl); - return build_x_binary_op (ARRAY_REF, op1, RECUR (TREE_OPERAND (t, 1)), + return build_x_binary_op (ARRAY_REF, op1, + (TREE_NO_WARNING (TREE_OPERAND (t, 0)) + ? ERROR_MARK + : TREE_CODE (TREE_OPERAND (t, 0))), + RECUR (TREE_OPERAND (t, 1)), + (TREE_NO_WARNING (TREE_OPERAND (t, 1)) + ? ERROR_MARK + : TREE_CODE (TREE_OPERAND (t, 1))), /*overloaded_p=*/NULL); case SIZEOF_EXPR: Modified: stable/9/contrib/gcc/cp/semantics.c ============================================================================== --- stable/9/contrib/gcc/cp/semantics.c Thu Dec 12 18:15:32 2013 (r259268) +++ stable/9/contrib/gcc/cp/semantics.c Thu Dec 12 18:16:46 2013 (r259269) @@ -587,6 +587,16 @@ maybe_convert_cond (tree cond) /* Do the conversion. */ cond = convert_from_reference (cond); + + if (TREE_CODE (cond) == MODIFY_EXPR + && !TREE_NO_WARNING (cond) + && warn_parentheses) + { + warning (OPT_Wparentheses, + "suggest parentheses around assignment used as truth value"); + TREE_NO_WARNING (cond) = 1; + } + return condition_conversion (cond); } Modified: stable/9/contrib/gcc/cp/tree.c ============================================================================== --- stable/9/contrib/gcc/cp/tree.c Thu Dec 12 18:15:32 2013 (r259268) +++ stable/9/contrib/gcc/cp/tree.c Thu Dec 12 18:16:46 2013 (r259269) @@ -1762,6 +1762,14 @@ pod_type_p (tree t) return 1; } +/* Nonzero iff type T is a class template implicit specialization. */ + +bool +class_tmpl_impl_spec_p (tree t) +{ + return CLASS_TYPE_P (t) && CLASSTYPE_TEMPLATE_INSTANTIATION (t); +} + /* Returns 1 iff zero initialization of type T means actually storing zeros in it. */ Modified: stable/9/contrib/gcc/cp/typeck.c ============================================================================== --- stable/9/contrib/gcc/cp/typeck.c Thu Dec 12 18:15:32 2013 (r259268) +++ stable/9/contrib/gcc/cp/typeck.c Thu Dec 12 18:16:46 2013 (r259269) @@ -1690,17 +1690,20 @@ rationalize_conditional_expr (enum tree_ are equal, so we know what conditional expression this used to be. */ if (TREE_CODE (t) == MIN_EXPR || TREE_CODE (t) == MAX_EXPR) { + tree op0 = TREE_OPERAND (t, 0); + tree op1 = TREE_OPERAND (t, 1); + /* The following code is incorrect if either operand side-effects. */ - gcc_assert (!TREE_SIDE_EFFECTS (TREE_OPERAND (t, 0)) - && !TREE_SIDE_EFFECTS (TREE_OPERAND (t, 1))); + gcc_assert (!TREE_SIDE_EFFECTS (op0) + && !TREE_SIDE_EFFECTS (op1)); return build_conditional_expr (build_x_binary_op ((TREE_CODE (t) == MIN_EXPR ? LE_EXPR : GE_EXPR), - TREE_OPERAND (t, 0), - TREE_OPERAND (t, 1), + op0, TREE_CODE (op0), + op1, TREE_CODE (op1), /*overloaded_p=*/NULL), - build_unary_op (code, TREE_OPERAND (t, 0), 0), - build_unary_op (code, TREE_OPERAND (t, 1), 0)); + build_unary_op (code, op0, 0), + build_unary_op (code, op1, 0)); } return @@ -2908,8 +2911,8 @@ convert_arguments (tree typelist, tree v conversions on the operands. CODE is the kind of expression to build. */ tree -build_x_binary_op (enum tree_code code, tree arg1, tree arg2, - bool *overloaded_p) +build_x_binary_op (enum tree_code code, tree arg1, enum tree_code arg1_code, + tree arg2, enum tree_code arg2_code, bool *overloaded_p) { tree orig_arg1; tree orig_arg2; @@ -2933,6 +2936,17 @@ build_x_binary_op (enum tree_code code, expr = build_new_op (code, LOOKUP_NORMAL, arg1, arg2, NULL_TREE, overloaded_p); + /* Check for cases such as x+y< Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 53F90E24; Thu, 12 Dec 2013 19:02:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3FE8F1E4F; Thu, 12 Dec 2013 19:02:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBCJ2JtC039557; Thu, 12 Dec 2013 19:02:19 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBCJ2JMs039556; Thu, 12 Dec 2013 19:02:19 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201312121902.rBCJ2JMs039556@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Thu, 12 Dec 2013 19:02:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r259272 - stable/9/contrib/gcclibs/libcpp X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Dec 2013 19:02:19 -0000 Author: pfg Date: Thu Dec 12 19:02:18 2013 New Revision: 259272 URL: http://svnweb.freebsd.org/changeset/base/259272 Log: MFC r258712; libcpp: fix an underflow. Similar fix seen in Apple's gcc42. Obtained from: OpenBSD (Rev 1.2) MFC after: 2 weeks Modified: stable/9/contrib/gcclibs/libcpp/charset.c Directory Properties: stable/9/ (props changed) stable/9/contrib/gcclibs/ (props changed) Modified: stable/9/contrib/gcclibs/libcpp/charset.c ============================================================================== --- stable/9/contrib/gcclibs/libcpp/charset.c Thu Dec 12 19:01:50 2013 (r259271) +++ stable/9/contrib/gcclibs/libcpp/charset.c Thu Dec 12 19:02:18 2013 (r259272) @@ -1628,7 +1628,7 @@ _cpp_convert_input (cpp_reader *pfile, c terminate with another \r, not an \n, so that we do not mistake the \r\n sequence for a single DOS line ending and erroneously issue the "No newline at end of file" diagnostic. */ - if (to.text[to.len - 1] == '\r') + if (to.len > 0 && to.text[to.len - 1] == '\r') to.text[to.len] = '\r'; else to.text[to.len] = '\n'; From owner-svn-src-stable-9@FreeBSD.ORG Thu Dec 12 19:18:31 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B73E6823 for ; Thu, 12 Dec 2013 19:18:31 +0000 (UTC) Received: from nm24-vm0.bullet.mail.bf1.yahoo.com (nm24-vm0.bullet.mail.bf1.yahoo.com [98.139.213.161]) by mx1.freebsd.org (Postfix) with SMTP id 5670A1F7A for ; Thu, 12 Dec 2013 19:18:31 +0000 (UTC) Received: from [98.139.212.152] by nm24.bullet.mail.bf1.yahoo.com with NNFMP; 12 Dec 2013 19:12:01 -0000 Received: from [98.139.211.196] by tm9.bullet.mail.bf1.yahoo.com with NNFMP; 12 Dec 2013 19:12:01 -0000 Received: from [127.0.0.1] by smtp205.mail.bf1.yahoo.com with NNFMP; 12 Dec 2013 19:12:01 -0000 X-Yahoo-Newman-Id: 108836.94461.bm@smtp205.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: xhTQvFEVM1mZejc0F0Y0w4Pkk89Kgo5IrHaN4Ld5LMykleU WZmISNuC5jzUTkoPWU1rb2gay_quVV_ux9lI.uTNjKQCEhHCQ7KBUWWUY.7Y ZoyVNvUOzRE2Di.K2DBjTLGdnpuLv1hGRKEFTKk6JMh99Rqa58FKHJXAkwuE tnR5VWilUovUJgVhDZeR_NtjG061py6ayVjCaft1KX1S6O5reGFlBI9DlHC8 QB1dLFcAdEYGZgcAj294To8NUg4KOAvJDmvXukBv7.oiGNzn_L6gweHeEY_i l5IwBieoSA1hadlx0H110_ufdNzFsgulCb0NxIMc2LxmZUZ9xWK71OeLKF0g tzOsfj6RlutILa.AMejert33wdEnNUQQlFoEXlvhFj6pAXo3nPF9SRLjvXSV C_BUekn_JrM6pyy2_WridlFVJlMllw.H8Ma8pGynwhC0Hyb9N0.kV2zBVpU1 288sbJy.qLPExDL1v6xN8nmmzmvugtu_s5tLZ5IYoB0KNYTho7cnhxpEBsyr mdYRgDipXvpYaWwj.tJNYojY3tdGaXcAq.lJd6rxwmQztf0AZOdXC0sPFVDa eYpgmCU0ZZsytJNwfqgRDohXNqMsi.Gm.X3eiNOM8h2lc6hOvTJcgscVtULL hRg7rMYPEyc3b52YLxBmArSUxkg-- X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf X-Rocket-Received: from [192.168.0.102] (pfg@190.157.126.109 with plain [98.138.105.21]) by smtp205.mail.bf1.yahoo.com with SMTP; 12 Dec 2013 11:12:00 -0800 PST Message-ID: <52AA0A7B.3000909@FreeBSD.org> Date: Thu, 12 Dec 2013 14:11:55 -0500 From: Pedro Giffuni User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 MIME-Version: 1.0 To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: Re: svn commit: r259272 - stable/9/contrib/gcclibs/libcpp References: <201312121902.rBCJ2JMs039556@svn.freebsd.org> In-Reply-To: <201312121902.rBCJ2JMs039556@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Dec 2013 19:18:31 -0000 On 12.12.2013 14:02, Pedro F. Giffuni wrote: > Author: pfg > Date: Thu Dec 12 19:02:18 2013 > New Revision: 259272 > URL: http://svnweb.freebsd.org/changeset/base/259272 > > Log: > MFC r258712; > > libcpp: fix an underflow. > > Similar fix seen in Apple's gcc42. > > Obtained from: OpenBSD (Rev 1.2) > MFC after: 2 weeks > > Oops.. will obviously not be MFC'd again :-P. From owner-svn-src-stable-9@FreeBSD.ORG Fri Dec 13 01:35:32 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 39F2D921; Fri, 13 Dec 2013 01:35:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2421E1DBC; Fri, 13 Dec 2013 01:35:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBD1ZWnt081214; Fri, 13 Dec 2013 01:35:32 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBD1ZWlH081213; Fri, 13 Dec 2013 01:35:32 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201312130135.rBD1ZWlH081213@svn.freebsd.org> From: Eitan Adler Date: Fri, 13 Dec 2013 01:35:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r259282 - stable/9/usr.sbin/mtest X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 01:35:32 -0000 Author: eadler Date: Fri Dec 13 01:35:31 2013 New Revision: 259282 URL: http://svnweb.freebsd.org/changeset/base/259282 Log: mtest(8): use correct macro in mdoc The An macros is used for authors while the Ar macro is used for arguments. AFAIK mcast-addr and ifname are not authors. PR: docs/184649 Modified: stable/9/usr.sbin/mtest/mtest.8 Directory Properties: stable/9/usr.sbin/mtest/ (props changed) Modified: stable/9/usr.sbin/mtest/mtest.8 ============================================================================== --- stable/9/usr.sbin/mtest/mtest.8 Fri Dec 13 00:56:05 2013 (r259281) +++ stable/9/usr.sbin/mtest/mtest.8 Fri Dec 13 01:35:31 2013 (r259282) @@ -131,9 +131,9 @@ to allow traffic from source Print .Ar n source filter entries for -.An mcast-addr +.Ar mcast-addr on interface -.An ifname . +.Ar ifname . .\" .Pp .It Ic f Ar filename From owner-svn-src-stable-9@FreeBSD.ORG Fri Dec 13 02:21:33 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7A8EDE1C; Fri, 13 Dec 2013 02:21:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 668861162; Fri, 13 Dec 2013 02:21:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBD2LXBn099329; Fri, 13 Dec 2013 02:21:33 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBD2LXYd099328; Fri, 13 Dec 2013 02:21:33 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201312130221.rBD2LXYd099328@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Fri, 13 Dec 2013 02:21:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r259283 - stable/9/contrib/libstdc++/include/std X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 02:21:33 -0000 Author: pfg Date: Fri Dec 13 02:21:32 2013 New Revision: 259283 URL: http://svnweb.freebsd.org/changeset/base/259283 Log: MFC r244673: Fix the __glibcxx_min and __glibcxx_max macros for a signed wchar_t. This seems to be needed by newer compilers. Modified: stable/9/contrib/libstdc++/include/std/std_limits.h Directory Properties: stable/9/ (props changed) stable/9/contrib/libstdc++/ (props changed) Modified: stable/9/contrib/libstdc++/include/std/std_limits.h ============================================================================== --- stable/9/contrib/libstdc++/include/std/std_limits.h Fri Dec 13 01:35:31 2013 (r259282) +++ stable/9/contrib/libstdc++/include/std/std_limits.h Fri Dec 13 02:21:32 2013 (r259283) @@ -134,10 +134,11 @@ #define __glibcxx_signed(T) ((T)(-1) < 0) #define __glibcxx_min(T) \ - (__glibcxx_signed (T) ? (T)1 << __glibcxx_digits (T) : (T)0) + (__glibcxx_signed (T) ? (((T)1 << (__glibcxx_digits (T) - 1)) << 1) : (T)0) #define __glibcxx_max(T) \ - (__glibcxx_signed (T) ? ((T)1 << __glibcxx_digits (T)) - 1 : ~(T)0) + (__glibcxx_signed (T) ? \ + (((((T)1 << (__glibcxx_digits (T) - 1)) - 1) << 1) + 1) : ~(T)0) #define __glibcxx_digits(T) \ (sizeof(T) * __CHAR_BIT__ - __glibcxx_signed (T)) From owner-svn-src-stable-9@FreeBSD.ORG Fri Dec 13 05:54:58 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A9F02A63; Fri, 13 Dec 2013 05:54:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9584A14A9; Fri, 13 Dec 2013 05:54:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBD5swoY075667; Fri, 13 Dec 2013 05:54:58 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBD5swkx075666; Fri, 13 Dec 2013 05:54:58 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201312130554.rBD5swkx075666@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 13 Dec 2013 05:54:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r259289 - stable/9/lib/libc/stdlib X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 05:54:58 -0000 Author: kib Date: Fri Dec 13 05:54:58 2013 New Revision: 259289 URL: http://svnweb.freebsd.org/changeset/base/259289 Log: MFC r259042: Do not force to run atexit handlers, which text comes from a dso owning the handle passed to __cxa_finalize() but which are registered by other dso, when the process is inside exit(3). Modified: stable/9/lib/libc/stdlib/atexit.c Directory Properties: stable/9/lib/libc/ (props changed) Modified: stable/9/lib/libc/stdlib/atexit.c ============================================================================== --- stable/9/lib/libc/stdlib/atexit.c Fri Dec 13 05:54:30 2013 (r259288) +++ stable/9/lib/libc/stdlib/atexit.c Fri Dec 13 05:54:58 2013 (r259289) @@ -151,6 +151,8 @@ __cxa_atexit(void (*func)(void *), void #pragma weak __pthread_cxa_finalize void __pthread_cxa_finalize(const struct dl_phdr_info *); +static int global_exit; + /* * Call all handlers registered with __cxa_atexit for the shared * object owning 'dso'. Note: if 'dso' is NULL, then all remaining @@ -164,10 +166,12 @@ __cxa_finalize(void *dso) struct atexit_fn fn; int n, has_phdr; - if (dso != NULL) + if (dso != NULL) { has_phdr = _rtld_addr_phdr(dso, &phdr_info); - else + } else { has_phdr = 0; + global_exit = 1; + } _MUTEX_LOCK(&atexit_mutex); for (p = __atexit; p; p = p->next) { @@ -177,8 +181,9 @@ __cxa_finalize(void *dso) fn = p->fns[n]; if (dso != NULL && dso != fn.fn_dso) { /* wrong DSO ? */ - if (!has_phdr || !__elf_phdr_match_addr( - &phdr_info, fn.fn_ptr.cxa_func)) + if (!has_phdr || global_exit || + !__elf_phdr_match_addr(&phdr_info, + fn.fn_ptr.cxa_func)) continue; } /* @@ -200,6 +205,6 @@ __cxa_finalize(void *dso) if (dso == NULL) _MUTEX_DESTROY(&atexit_mutex); - if (has_phdr && &__pthread_cxa_finalize != NULL) + if (has_phdr && !global_exit && &__pthread_cxa_finalize != NULL) __pthread_cxa_finalize(&phdr_info); } From owner-svn-src-stable-9@FreeBSD.ORG Fri Dec 13 06:01:21 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D410CEE5; Fri, 13 Dec 2013 06:01:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BFECF1530; Fri, 13 Dec 2013 06:01:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBD61LS5079083; Fri, 13 Dec 2013 06:01:21 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBD61LkD079081; Fri, 13 Dec 2013 06:01:21 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201312130601.rBD61LkD079081@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 13 Dec 2013 06:01:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r259291 - stable/9/libexec/rtld-elf X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 06:01:21 -0000 Author: kib Date: Fri Dec 13 06:01:21 2013 New Revision: 259291 URL: http://svnweb.freebsd.org/changeset/base/259291 Log: MFC r259043: Build an allocator for the aligned memory on top of the rtld-private malloc. Modified: stable/9/libexec/rtld-elf/rtld.h stable/9/libexec/rtld-elf/xmalloc.c Directory Properties: stable/9/libexec/rtld-elf/ (props changed) Modified: stable/9/libexec/rtld-elf/rtld.h ============================================================================== --- stable/9/libexec/rtld-elf/rtld.h Fri Dec 13 06:00:44 2013 (r259290) +++ stable/9/libexec/rtld-elf/rtld.h Fri Dec 13 06:01:21 2013 (r259291) @@ -352,6 +352,8 @@ Obj_Entry *map_object(int, const char *, void *xcalloc(size_t, size_t); void *xmalloc(size_t); char *xstrdup(const char *); +void *malloc_aligned(size_t size, size_t align); +void free_aligned(void *ptr); extern Elf_Addr _GLOBAL_OFFSET_TABLE_[]; extern Elf_Sym sym_zero; /* For resolving undefined weak refs. */ Modified: stable/9/libexec/rtld-elf/xmalloc.c ============================================================================== --- stable/9/libexec/rtld-elf/xmalloc.c Fri Dec 13 06:00:44 2013 (r259290) +++ stable/9/libexec/rtld-elf/xmalloc.c Fri Dec 13 06:01:21 2013 (r259291) @@ -67,3 +67,33 @@ xstrdup(const char *str) memcpy(copy, str, len); return (copy); } + +void * +malloc_aligned(size_t size, size_t align) +{ + void *mem, *res; + uintptr_t x; + size_t asize, r; + + r = round(sizeof(void *), align); + asize = round(size, align) + r; + mem = xmalloc(asize); + x = (uintptr_t)mem; + res = (void *)round(x, align); + *(void **)((uintptr_t)res - sizeof(void *)) = mem; + return (res); +} + +void +free_aligned(void *ptr) +{ + void *mem; + uintptr_t x; + + if (ptr == NULL) + return; + x = (uintptr_t)ptr; + x -= sizeof(void *); + mem = *(void **)x; + free(mem); +} From owner-svn-src-stable-9@FreeBSD.ORG Fri Dec 13 06:06:25 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BDF812E4; Fri, 13 Dec 2013 06:06:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A8025158A; Fri, 13 Dec 2013 06:06:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBD66PVr079981; Fri, 13 Dec 2013 06:06:25 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBD66Pwu079980; Fri, 13 Dec 2013 06:06:25 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201312130606.rBD66Pwu079980@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 13 Dec 2013 06:06:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r259293 - stable/9/libexec/rtld-elf X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 06:06:25 -0000 Author: kib Date: Fri Dec 13 06:06:25 2013 New Revision: 259293 URL: http://svnweb.freebsd.org/changeset/base/259293 Log: MFC r259044: For variant II static TLS, properly align tls segments. MFC r259072: Cast Elf_Addr to void * to match the free_aligned() argument type. Modified: stable/9/libexec/rtld-elf/rtld.c Directory Properties: stable/9/libexec/rtld-elf/ (props changed) Modified: stable/9/libexec/rtld-elf/rtld.c ============================================================================== --- stable/9/libexec/rtld-elf/rtld.c Fri Dec 13 06:06:08 2013 (r259292) +++ stable/9/libexec/rtld-elf/rtld.c Fri Dec 13 06:06:25 2013 (r259293) @@ -231,6 +231,7 @@ char **main_argv; size_t tls_last_offset; /* Static TLS offset of last module */ size_t tls_last_size; /* Static TLS size of last module */ size_t tls_static_space; /* Static TLS space allocated */ +size_t tls_static_max_align; int tls_dtv_generation = 1; /* Used to detect when dtv size changes */ int tls_max_index = 1; /* Largest module index allocated */ @@ -4281,19 +4282,22 @@ void * allocate_tls(Obj_Entry *objs, void *oldtls, size_t tcbsize, size_t tcbalign) { Obj_Entry *obj; - size_t size; + size_t size, ralign; char *tls; Elf_Addr *dtv, *olddtv; Elf_Addr segbase, oldsegbase, addr; int i; - size = round(tls_static_space, tcbalign); + ralign = tcbalign; + if (tls_static_max_align > ralign) + ralign = tls_static_max_align; + size = round(tls_static_space, ralign) + round(tcbsize, ralign); assert(tcbsize >= 2*sizeof(Elf_Addr)); - tls = xcalloc(1, size + tcbsize); + tls = malloc_aligned(size, ralign); dtv = xcalloc(tls_max_index + 2, sizeof(Elf_Addr)); - segbase = (Elf_Addr)(tls + size); + segbase = (Elf_Addr)(tls + round(tls_static_space, ralign)); ((Elf_Addr*)segbase)[0] = segbase; ((Elf_Addr*)segbase)[1] = (Elf_Addr) dtv; @@ -4345,8 +4349,8 @@ allocate_tls(Obj_Entry *objs, void *oldt void free_tls(void *tls, size_t tcbsize, size_t tcbalign) { - size_t size; Elf_Addr* dtv; + size_t size, ralign; int dtvsize, i; Elf_Addr tlsstart, tlsend; @@ -4354,19 +4358,22 @@ free_tls(void *tls, size_t tcbsize, size * Figure out the size of the initial TLS block so that we can * find stuff which ___tls_get_addr() allocated dynamically. */ - size = round(tls_static_space, tcbalign); + ralign = tcbalign; + if (tls_static_max_align > ralign) + ralign = tls_static_max_align; + size = round(tls_static_space, ralign); dtv = ((Elf_Addr**)tls)[1]; dtvsize = dtv[1]; tlsend = (Elf_Addr) tls; tlsstart = tlsend - size; for (i = 0; i < dtvsize; i++) { - if (dtv[i+2] && (dtv[i+2] < tlsstart || dtv[i+2] > tlsend)) { - free((void*) dtv[i+2]); + if (dtv[i + 2] != 0 && (dtv[i + 2] < tlsstart || dtv[i + 2] > tlsend)) { + free_aligned((void *)dtv[i + 2]); } } - free((void*) tlsstart); + free_aligned((void *)tlsstart); free((void*) dtv); } @@ -4390,11 +4397,7 @@ allocate_module_tls(int index) die(); } - p = malloc(obj->tlssize); - if (p == NULL) { - _rtld_error("Cannot allocate TLS block for index %d", index); - die(); - } + p = malloc_aligned(obj->tlssize, obj->tlsalign); memcpy(p, obj->tlsinit, obj->tlsinitsize); memset(p + obj->tlsinitsize, 0, obj->tlssize - obj->tlsinitsize); @@ -4426,9 +4429,11 @@ allocate_tls_offset(Obj_Entry *obj) * leave a small amount of space spare to be used for dynamically * loading modules which use static TLS. */ - if (tls_static_space) { + if (tls_static_space != 0) { if (calculate_tls_end(off, obj->tlssize) > tls_static_space) return false; + } else if (obj->tlsalign > tls_static_max_align) { + tls_static_max_align = obj->tlsalign; } tls_last_offset = obj->tlsoffset = off; From owner-svn-src-stable-9@FreeBSD.ORG Fri Dec 13 06:25:44 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 45733DE2; Fri, 13 Dec 2013 06:25:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2940616E4; Fri, 13 Dec 2013 06:25:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBD6PikT087312; Fri, 13 Dec 2013 06:25:44 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBD6PikL087311; Fri, 13 Dec 2013 06:25:44 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201312130625.rBD6PikL087311@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 13 Dec 2013 06:25:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r259298 - stable/9/sys/vm X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 06:25:44 -0000 Author: kib Date: Fri Dec 13 06:25:43 2013 New Revision: 259298 URL: http://svnweb.freebsd.org/changeset/base/259298 Log: MFC r258366: Add assertions to cover all places in the wiring and unwiring code where MAP_ENTRY_IN_TRANSITION is set or cleared. Modified: stable/9/sys/vm/vm_map.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/vm/vm_map.c ============================================================================== --- stable/9/sys/vm/vm_map.c Fri Dec 13 06:25:08 2013 (r259297) +++ stable/9/sys/vm/vm_map.c Fri Dec 13 06:25:43 2013 (r259298) @@ -2289,6 +2289,9 @@ vm_map_unwire(vm_map_t map, vm_offset_t * Mark the entry in case the map lock is released. (See * above.) */ + KASSERT((entry->eflags & MAP_ENTRY_IN_TRANSITION) == 0 && + entry->wiring_thread == NULL, + ("owned map entry %p", entry)); entry->eflags |= MAP_ENTRY_IN_TRANSITION; entry->wiring_thread = curthread; /* @@ -2357,7 +2360,9 @@ done: } } KASSERT((entry->eflags & MAP_ENTRY_IN_TRANSITION) != 0, - ("vm_map_unwire: in-transition flag missing")); + ("vm_map_unwire: in-transition flag missing %p", entry)); + KASSERT(entry->wiring_thread == curthread, + ("vm_map_unwire: alien wire %p", entry)); entry->eflags &= ~MAP_ENTRY_IN_TRANSITION; entry->wiring_thread = NULL; if (entry->eflags & MAP_ENTRY_NEEDS_WAKEUP) { @@ -2457,6 +2462,9 @@ vm_map_wire(vm_map_t map, vm_offset_t st * Mark the entry in case the map lock is released. (See * above.) */ + KASSERT((entry->eflags & MAP_ENTRY_IN_TRANSITION) == 0 && + entry->wiring_thread == NULL, + ("owned map entry %p", entry)); entry->eflags |= MAP_ENTRY_IN_TRANSITION; entry->wiring_thread = curthread; if ((entry->protection & (VM_PROT_READ | VM_PROT_EXECUTE)) == 0 From owner-svn-src-stable-9@FreeBSD.ORG Fri Dec 13 06:29:03 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 232D21AA; Fri, 13 Dec 2013 06:29:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E93961712; Fri, 13 Dec 2013 06:29:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBD6T2SC087751; Fri, 13 Dec 2013 06:29:02 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBD6T2je087750; Fri, 13 Dec 2013 06:29:02 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201312130629.rBD6T2je087750@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 13 Dec 2013 06:29:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r259300 - stable/9/sys/vm X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 06:29:03 -0000 Author: kib Date: Fri Dec 13 06:29:02 2013 New Revision: 259300 URL: http://svnweb.freebsd.org/changeset/base/259300 Log: MFC r258367: Verify for zero-length requests and act as if it is always successfull without performing any action on the address space. Modified: stable/9/sys/vm/vm_map.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/vm/vm_map.c ============================================================================== --- stable/9/sys/vm/vm_map.c Fri Dec 13 06:28:18 2013 (r259299) +++ stable/9/sys/vm/vm_map.c Fri Dec 13 06:29:02 2013 (r259300) @@ -1894,6 +1894,9 @@ vm_map_protect(vm_map_t map, vm_offset_t struct ucred *cred; vm_prot_t old_prot; + if (start == end) + return (KERN_SUCCESS); + vm_map_lock(map); VM_MAP_RANGE_CHECK(map, start, end); @@ -2048,12 +2051,16 @@ vm_map_madvise( case MADV_AUTOSYNC: case MADV_NOCORE: case MADV_CORE: + if (start == end) + return (KERN_SUCCESS); modify_map = 1; vm_map_lock(map); break; case MADV_WILLNEED: case MADV_DONTNEED: case MADV_FREE: + if (start == end) + return (KERN_SUCCESS); vm_map_lock_read(map); break; default: @@ -2191,6 +2198,8 @@ vm_map_inherit(vm_map_t map, vm_offset_t default: return (KERN_INVALID_ARGUMENT); } + if (start == end) + return (KERN_SUCCESS); vm_map_lock(map); VM_MAP_RANGE_CHECK(map, start, end); if (vm_map_lookup_entry(map, start, &temp_entry)) { @@ -2223,6 +2232,8 @@ vm_map_unwire(vm_map_t map, vm_offset_t int rv; boolean_t need_wakeup, result, user_unwire; + if (start == end) + return (KERN_SUCCESS); user_unwire = (flags & VM_MAP_WIRE_USER) ? TRUE : FALSE; vm_map_lock(map); VM_MAP_RANGE_CHECK(map, start, end); @@ -2393,6 +2404,8 @@ vm_map_wire(vm_map_t map, vm_offset_t st boolean_t fictitious, need_wakeup, result, user_wire; vm_prot_t prot; + if (start == end) + return (KERN_SUCCESS); prot = 0; if (flags & VM_MAP_WIRE_WRITE) prot |= VM_PROT_WRITE; @@ -2835,6 +2848,8 @@ vm_map_delete(vm_map_t map, vm_offset_t vm_map_entry_t first_entry; VM_MAP_ASSERT_LOCKED(map); + if (start == end) + return (KERN_SUCCESS); /* * Find the start of the region, and clip it From owner-svn-src-stable-9@FreeBSD.ORG Fri Dec 13 18:24:36 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EBE6BE1; Fri, 13 Dec 2013 18:24:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D6A261047; Fri, 13 Dec 2013 18:24:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBDIOax6063709; Fri, 13 Dec 2013 18:24:36 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBDIOabU063708; Fri, 13 Dec 2013 18:24:36 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201312131824.rBDIOabU063708@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Fri, 13 Dec 2013 18:24:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r259321 - stable/9/contrib/gperf/src X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 18:24:37 -0000 Author: pfg Date: Fri Dec 13 18:24:36 2013 New Revision: 259321 URL: http://svnweb.freebsd.org/changeset/base/259321 Log: MFC r258115 (partial); gperf: bring a small update from Apple Developers tools 4.4 From [1] offset.patch Makes use the C offsetof() macro. We are not merging the size_type.patch as it raises some (apparently) bogus warnings and is not really used. [1] http://opensource.apple.com/source/gperf/gperf-9/patches/ Modified: stable/9/contrib/gperf/src/output.cc Directory Properties: stable/9/ (props changed) stable/9/contrib/gperf/ (props changed) Modified: stable/9/contrib/gperf/src/output.cc ============================================================================== --- stable/9/contrib/gperf/src/output.cc Fri Dec 13 18:23:14 2013 (r259320) +++ stable/9/contrib/gperf/src/output.cc Fri Dec 13 18:24:36 2013 (r259321) @@ -1106,9 +1106,7 @@ output_keyword_entry (KeywordExt *temp, if (option[TYPE]) printf ("{"); if (option[SHAREDLIB]) - printf ("(int)(long)&((struct %s_t *)0)->%s_str%d", - option.get_stringpool_name (), option.get_stringpool_name (), - stringpool_index); + printf("offsetof(struct %s_t, %s_str%d)", option.get_stringpool_name (), option.get_stringpool_name (), stringpool_index); else output_string (temp->_allchars, temp->_allchars_length); if (option[TYPE]) @@ -2035,8 +2033,11 @@ Output::output () printf ("%s\n", _struct_decl); } - if (option[INCLUDE]) + if (option[INCLUDE]) { printf ("#include \n"); /* Declare strlen(), strcmp(), strncmp(). */ + if (option[SHAREDLIB]) + printf("#include \n"); /* Declare offsetof() */ + } if (!option[ENUM]) { From owner-svn-src-stable-9@FreeBSD.ORG Fri Dec 13 19:38:06 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3AE25BAE; Fri, 13 Dec 2013 19:38:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0BF151574; Fri, 13 Dec 2013 19:38:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBDJc50d089802; Fri, 13 Dec 2013 19:38:05 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBDJc5o8089801; Fri, 13 Dec 2013 19:38:05 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201312131938.rBDJc5o8089801@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Fri, 13 Dec 2013 19:38:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r259327 - stable/9/contrib/tcpdump X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 19:38:06 -0000 Author: pfg Date: Fri Dec 13 19:38:05 2013 New Revision: 259327 URL: http://svnweb.freebsd.org/changeset/base/259327 Log: MFV r258571: Removes strict-aliasing warnings from newer GCC in tcpdump. Corresponds to MFC r258573, but for some reason our new pre-commit hooks will not let us merge it from there. Modified: stable/9/contrib/tcpdump/extract.h Modified: stable/9/contrib/tcpdump/extract.h ============================================================================== --- stable/9/contrib/tcpdump/extract.h Fri Dec 13 19:32:02 2013 (r259326) +++ stable/9/contrib/tcpdump/extract.h Fri Dec 13 19:38:05 2013 (r259327) @@ -51,13 +51,25 @@ typedef struct { u_int32_t val; } __attribute__((packed)) unaligned_u_int32_t; -#define EXTRACT_16BITS(p) \ - ((u_int16_t)ntohs(((const unaligned_u_int16_t *)(p))->val)) -#define EXTRACT_32BITS(p) \ - ((u_int32_t)ntohl(((const unaligned_u_int32_t *)(p))->val)) -#define EXTRACT_64BITS(p) \ - ((u_int64_t)(((u_int64_t)ntohl(((const unaligned_u_int32_t *)(p) + 0)->val)) << 32 | \ - ((u_int64_t)ntohl(((const unaligned_u_int32_t *)(p) + 1)->val)) << 0)) +static inline u_int16_t +EXTRACT_16BITS(const void *p) +{ + return ((u_int16_t)ntohs(((const unaligned_u_int16_t *)(p))->val)); +} + +static inline u_int32_t +EXTRACT_32BITS(const void *p) +{ + return ((u_int32_t)ntohl(((const unaligned_u_int32_t *)(p))->val)); +} + +static inline u_int64_t +EXTRACT_64BITS(const void *p) +{ + return ((u_int64_t)(((u_int64_t)ntohl(((const unaligned_u_int32_t *)(p) + 0)->val)) << 32 | \ + ((u_int64_t)ntohl(((const unaligned_u_int32_t *)(p) + 1)->val)) << 0)); + +} #else /* HAVE___ATTRIBUTE__ */ /* @@ -88,13 +100,26 @@ typedef struct { * The processor natively handles unaligned loads, so we can just * cast the pointer and fetch through it. */ -#define EXTRACT_16BITS(p) \ - ((u_int16_t)ntohs(*(const u_int16_t *)(p))) -#define EXTRACT_32BITS(p) \ - ((u_int32_t)ntohl(*(const u_int32_t *)(p))) -#define EXTRACT_64BITS(p) \ - ((u_int64_t)(((u_int64_t)ntohl(*((const u_int32_t *)(p) + 0))) << 32 | \ - ((u_int64_t)ntohl(*((const u_int32_t *)(p) + 1))) << 0)) +static inline u_int16_t +EXTRACT_16BITS(const void *p) +{ + return ((u_int16_t)ntohs(*(const u_int16_t *)(p))); +} + +static inline u_int32_t +EXTRACT_32BITS(const void *p) +{ + return ((u_int32_t)ntohl(*(const u_int32_t *)(p))); +} + +static inline u_int64_t +EXTRACT_64BITS(const void *p) +{ + return ((u_int64_t)(((u_int64_t)ntohl(*((const u_int32_t *)(p) + 0))) << 32 | \ + ((u_int64_t)ntohl(*((const u_int32_t *)(p) + 1))) << 0)); + +} + #endif /* LBL_ALIGN */ #define EXTRACT_24BITS(p) \ From owner-svn-src-stable-9@FreeBSD.ORG Sat Dec 14 04:16:47 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A6458EAA; Sat, 14 Dec 2013 04:16:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 926C1133E; Sat, 14 Dec 2013 04:16:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBE4Glud089346; Sat, 14 Dec 2013 04:16:47 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBE4GlUP089345; Sat, 14 Dec 2013 04:16:47 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201312140416.rBE4GlUP089345@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Sat, 14 Dec 2013 04:16:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r259384 - stable/9/sys/geom/eli X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Dec 2013 04:16:47 -0000 Author: ae Date: Sat Dec 14 04:16:47 2013 New Revision: 259384 URL: http://svnweb.freebsd.org/changeset/base/259384 Log: MFC r257965: Add missing line breaks. PR: 181900 Modified: stable/9/sys/geom/eli/g_eli.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/geom/eli/g_eli.c ============================================================================== --- stable/9/sys/geom/eli/g_eli.c Sat Dec 14 04:16:27 2013 (r259383) +++ stable/9/sys/geom/eli/g_eli.c Sat Dec 14 04:16:47 2013 (r259384) @@ -1163,9 +1163,9 @@ g_eli_dumpconf(struct sbuf *sb, const ch if (pp != NULL || cp != NULL) return; /* Nothing here. */ - sbuf_printf(sb, "%s%ju", indent, + sbuf_printf(sb, "%s%ju\n", indent, (uintmax_t)sc->sc_ekeys_total); - sbuf_printf(sb, "%s%ju", indent, + sbuf_printf(sb, "%s%ju\n", indent, (uintmax_t)sc->sc_ekeys_allocated); sbuf_printf(sb, "%s", indent); if (sc->sc_flags == 0) From owner-svn-src-stable-9@FreeBSD.ORG Sat Dec 14 04:27:29 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F3AD45D3; Sat, 14 Dec 2013 04:27:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DF5211473; Sat, 14 Dec 2013 04:27:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBE4RSa5093366; Sat, 14 Dec 2013 04:27:28 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBE4RSk1093365; Sat, 14 Dec 2013 04:27:28 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201312140427.rBE4RSk1093365@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Sat, 14 Dec 2013 04:27:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r259387 - stable/9/sys/netipsec X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Dec 2013 04:27:29 -0000 Author: ae Date: Sat Dec 14 04:27:28 2013 New Revision: 259387 URL: http://svnweb.freebsd.org/changeset/base/259387 Log: MFC r257987: Initialize prot variable. PR: 177417 Modified: stable/9/sys/netipsec/ipsec_input.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netipsec/ipsec_input.c ============================================================================== --- stable/9/sys/netipsec/ipsec_input.c Sat Dec 14 04:24:50 2013 (r259386) +++ stable/9/sys/netipsec/ipsec_input.c Sat Dec 14 04:27:28 2013 (r259387) @@ -602,6 +602,7 @@ ipsec6_common_input_cb(struct mbuf *m, s ip6->ip6_plen = htons(m->m_pkthdr.len - sizeof(struct ip6_hdr)); /* Save protocol */ + prot = 0; m_copydata(m, protoff, 1, (unsigned char *) &prot); #ifdef notyet