From owner-freebsd-toolchain@FreeBSD.ORG Wed May 16 20:27:11 2012 Return-Path: Delivered-To: toolchain@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D558E1065670 for ; Wed, 16 May 2012 20:27:11 +0000 (UTC) (envelope-from erik@cederstrand.dk) Received: from csmtp3.one.com (csmtp3.one.com [91.198.169.23]) by mx1.freebsd.org (Postfix) with ESMTP id 7B09C8FC15 for ; Wed, 16 May 2012 20:27:11 +0000 (UTC) Received: from [192.168.1.15] (unknown [217.157.7.221]) by csmtp3.one.com (Postfix) with ESMTPA id 35AF3242BB72 for ; Wed, 16 May 2012 20:27:10 +0000 (UTC) From: Erik Cederstrand Content-Type: multipart/mixed; boundary="Apple-Mail=_66DC85C9-BA2A-4669-9DD5-E0AB01E81FCA" Date: Wed, 16 May 2012 22:27:10 +0200 Message-Id: <21DCECE3-64F2-4D50-879A-5F9EA6E442BD@cederstrand.dk> To: toolchain@freebsd.org Mime-Version: 1.0 (Apple Message framework v1278) X-Mailer: Apple Mail (2.1278) Cc: Subject: [patch] Add "-iremap src:dst" option to gcc X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 May 2012 20:27:11 -0000 --Apple-Mail=_66DC85C9-BA2A-4669-9DD5-E0AB01E81FCA Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Hi folks, I found this patch by Joerg Sonnenberger to NetBSD's gcc which adds an = "-iremap src:dst" option to gcc = (http://www.mail-archive.com/source-changes-full@netbsd.org/msg08590.html)= . The option rewrites the prefix to __FILE__ which is stored in the object = file. My use-case is to make __FILE__ a relative path instead of an = absolute one, e.g. "src/foo/bar.c" instead of = "/home/erik/freebsd/gcc_iremap/src/foo/bar.c". This is one of the = requisites to create identical binaries from source code in different = locations on my system. The option can be used in e.g. make.conf as: CFLAGS +=3D -iunwrap=3D${.IMPSRC}:src Patch against HEAD is attached. Is anyone willing to review this and = possibly commit? Thanks, Erik --Apple-Mail=_66DC85C9-BA2A-4669-9DD5-E0AB01E81FCA Content-Disposition: attachment; filename=iremap.diff Content-Type: application/octet-stream; name="iremap.diff" Content-Transfer-Encoding: 7bit Index: contrib/gcc/doc/cpp.texi =================================================================== --- contrib/gcc/doc/cpp.texi (revision 235514) +++ contrib/gcc/doc/cpp.texi (working copy) @@ -4167,6 +4167,7 @@ @c man begin SYNOPSIS cpp [@option{-D}@var{macro}[=@var{defn}]@dots{}] [@option{-U}@var{macro}] [@option{-I}@var{dir}@dots{}] [@option{-iquote}@var{dir}@dots{}] + [@option{-iremap}@var{src}:@var{dst}] [@option{-W}@var{warn}@dots{}] [@option{-M}|@option{-MM}] [@option{-MG}] [@option{-MF} @var{filename}] [@option{-MP}] [@option{-MQ} @var{target}@dots{}] Index: contrib/gcc/doc/gcc.1 =================================================================== --- contrib/gcc/doc/gcc.1 (revision 235514) +++ contrib/gcc/doc/gcc.1 (working copy) @@ -379,7 +379,8 @@ \&\fB\-u\fR \fIsymbol\fR .IP "\fIDirectory Options\fR" 4 .IX Item "Directory Options" -\&\fB\-B\fR\fIprefix\fR \fB\-I\fR\fIdir\fR \fB\-iquote\fR\fIdir\fR \fB\-L\fR\fIdir\fR +\&\fB\-B\fR\fIprefix\fR \fB\-I\fR\fIdir\fR \fB\-iquote\fR\fIdir\fR +\fB\-iremap\fR\fIsrc:dst\fR \fB\-L\fR\fIdir\fR \&\fB\-specs=\fR\fIfile\fR \fB\-I\- \-\-sysroot=\fR\fIdir\fR .IP "\fITarget Options\fR" 4 .IX Item "Target Options" @@ -6165,6 +6166,11 @@ \&\f(CW\*(C`#include\ "\f(CIfile\f(CW"\*(C'\fR; they are not searched for \&\f(CW\*(C`#include\ <\f(CIfile\f(CW>\*(C'\fR, before all directories specified by \&\fB\-I\fR and before the standard system directories. +.IP "\fB\-iremap\fR \fIsrc:dst\fR" 4 +.IX Item "-iremap src:dst" +Replace the prefix \fIsrc\fR in \fI__FILE__\fR with \fIdst\fR at expansion time. +This option can be specified more than once. Processing stops at the first match. +Processing stops at the first match. .IP "\fB\-fdollars\-in\-identifiers\fR" 4 .IX Item "-fdollars-in-identifiers" Accept \fB$\fR in identifiers. Index: contrib/gcc/doc/cppopts.texi =================================================================== --- contrib/gcc/doc/cppopts.texi (revision 235514) +++ contrib/gcc/doc/cppopts.texi (working copy) @@ -506,6 +506,12 @@ @xref{Search Path}. @end ifset +@item -iremap @var{src}:@var{dst} +@opindex iremap +Replace the prefix @var{src} in __FILE__ with @var{dst} at expansion time. +This option can be specified more than once. Processing stops at the first +match. + @item -fdollars-in-identifiers @opindex fdollars-in-identifiers @anchor{fdollars-in-identifiers} Index: contrib/gcc/doc/invoke.texi =================================================================== --- contrib/gcc/doc/invoke.texi (revision 235514) +++ contrib/gcc/doc/invoke.texi (working copy) @@ -360,7 +360,8 @@ @item Directory Options @xref{Directory Options,,Options for Directory Search}. -@gccoptlist{-B@var{prefix} -I@var{dir} -iquote@var{dir} -L@var{dir} +@gccoptlist{-B@var{prefix} -I@var{dir} -iquote@var{dir} +-iremap@var{src}:@var{dst} -L@var{dir} -specs=@var{file} -I- --sysroot=@var{dir}} @item Target Options @@ -6406,6 +6407,12 @@ "@var{file}"}; they are not searched for @samp{#include <@var{file}>}, otherwise just like @option{-I}. +@item -iremap @var{src}:@var{dst} +@opindex iremap +Replace the prefix @var{src} in __FILE__ with @var{dst} at expansion time. +This option can be specified more than once. Processing stops at the first +match. + @item -L@var{dir} @opindex L Add directory @var{dir} to the list of directories to be searched Index: contrib/gcc/doc/cpp.1 =================================================================== --- contrib/gcc/doc/cpp.1 (revision 235514) +++ contrib/gcc/doc/cpp.1 (working copy) @@ -649,6 +649,11 @@ \&\f(CW\*(C`#include\ "\f(CIfile\f(CW"\*(C'\fR; they are not searched for \&\f(CW\*(C`#include\ <\f(CIfile\f(CW>\*(C'\fR, before all directories specified by \&\fB\-I\fR and before the standard system directories. +.IP "\fB\-iremap\fR \fIsrc:dst\fR" 4 +.IX Item "-iremap src:dst" +Replace the prefix \fIsrc\fR in \fI__FILE__\fR with \fIdst\fR at expansion time. +This option can be specified more than once. Processing stops at the first match. +Processing stops at the first match. .IP "\fB\-fdollars\-in\-identifiers\fR" 4 .IX Item "-fdollars-in-identifiers" Accept \fB$\fR in identifiers. Index: contrib/gcc/gcc.h =================================================================== --- contrib/gcc/gcc.h (revision 235514) +++ contrib/gcc/gcc.h (working copy) @@ -49,7 +49,7 @@ || !strcmp (STR, "idirafter") || !strcmp (STR, "iprefix") \ || !strcmp (STR, "iwithprefix") || !strcmp (STR, "iwithprefixbefore") \ || !strcmp (STR, "iquote") || !strcmp (STR, "isystem") \ - || !strcmp (STR, "isysroot") \ + || !strcmp (STR, "iremap") || !strcmp (STR, "isysroot") \ || !strcmp (STR, "-param") || !strcmp (STR, "specs") \ || !strcmp (STR, "MF") || !strcmp (STR, "MT") || !strcmp (STR, "MQ")) Index: contrib/gcc/c.opt =================================================================== --- contrib/gcc/c.opt (revision 235514) +++ contrib/gcc/c.opt (working copy) @@ -781,6 +781,10 @@ C ObjC C++ ObjC++ Joined Separate -iprefix Specify as a prefix for next two options +iremap +C ObjC C++ ObjC++ Joined Separate +-iremap Convert to if it occurs as prefix in __FILE__. + isysroot C ObjC C++ ObjC++ Joined Separate -isysroot Set to be the system root directory Index: contrib/gcc/c-opts.c =================================================================== --- contrib/gcc/c-opts.c (revision 235514) +++ contrib/gcc/c-opts.c (working copy) @@ -169,6 +169,7 @@ case OPT_isysroot: case OPT_isystem: case OPT_iquote: + case OPT_iremap: error ("missing path after %qs", opt); break; @@ -839,6 +840,10 @@ add_path (xstrdup (arg), QUOTE, 0, true); break; + case OPT_iremap: + add_cpp_remap_path (arg); + break; + case OPT_isysroot: sysroot = arg; break; Index: contrib/gcclibs/libcpp/macro.c =================================================================== --- contrib/gcclibs/libcpp/macro.c (revision 235514) +++ contrib/gcclibs/libcpp/macro.c (working copy) @@ -107,6 +107,61 @@ "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }; +static size_t remap_pairs; +static char **remap_src; +static char **remap_dst; + +void +add_cpp_remap_path (const char *arg) +{ + const char *arg_dst; + size_t len; + + arg_dst = strchr(arg, ':'); + if (arg_dst == NULL) { + fprintf(stderr, "Invalid argument for -iremap"); + exit(1); + } + len = arg_dst - arg; + ++arg_dst; + + remap_src = xrealloc(remap_src, sizeof(char *) * (remap_pairs + 1)); + remap_dst = xrealloc(remap_dst, sizeof(char *) * (remap_pairs + 1)); + + remap_src[remap_pairs] = xmalloc(len + 1); + memcpy(remap_src[remap_pairs], arg, len); + remap_src[remap_pairs][len] = '\0'; + remap_dst[remap_pairs] = xstrdup(arg_dst); + ++remap_pairs; +} + +static const char * +cpp_remap_file (const char *arg, char **tmp_name) +{ + char *result; + size_t i, len; + + for (i = 0; i < remap_pairs; ++i) { + len = strlen (remap_src[i]); + if (strncmp (remap_src[i], arg, len)) + continue; + if (arg[len] == '\0') + return xstrdup (remap_dst[i]); + if (arg[len] != '/') + continue; + arg += len; + len = strlen (remap_dst[i]); + result = xmalloc (len + strlen (arg) + 1); + memcpy(result, remap_dst[i], len); + strcpy(result + len, arg); + *tmp_name = result; + + return result; + } + + return arg; +} + /* Helper function for builtin_macro. Returns the text generated by a builtin macro. */ const uchar * @@ -166,6 +221,7 @@ { unsigned int len; const char *name; + char *tmp_name; uchar *buf; map = linemap_lookup (pfile->line_table, pfile->line_table->highest_line); @@ -173,12 +229,14 @@ while (! MAIN_FILE_P (map)) map = INCLUDED_FROM (pfile->line_table, map); - name = map->to_file; + tmp_name = NULL; + name = cpp_remap_file (map->to_file, &tmp_name); len = strlen (name); buf = _cpp_unaligned_alloc (pfile, len * 2 + 3); result = buf; *buf = '"'; buf = cpp_quote_string (buf + 1, (const unsigned char *) name, len); + free (tmp_name); *buf++ = '"'; *buf = '\0'; } Index: contrib/gcclibs/libcpp/include/cpplib.h =================================================================== --- contrib/gcclibs/libcpp/include/cpplib.h (revision 235514) +++ contrib/gcclibs/libcpp/include/cpplib.h (working copy) @@ -627,6 +627,9 @@ /* Set the include paths. */ extern void cpp_set_include_chains (cpp_reader *, cpp_dir *, cpp_dir *, int); +/* Provide src:dst pair for __FILE__ remapping. */ +extern void add_cpp_remap_path (const char *); + /* Call these to get pointers to the options, callback, and deps structures for a given reader. These pointers are good until you call cpp_finish on that reader. You can either edit the callbacks --Apple-Mail=_66DC85C9-BA2A-4669-9DD5-E0AB01E81FCA-- From owner-freebsd-toolchain@FreeBSD.ORG Thu May 17 15:51:30 2012 Return-Path: Delivered-To: freebsd-toolchain@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 223FC106567F for ; Thu, 17 May 2012 15:51:30 +0000 (UTC) (envelope-from pfg@freebsd.org) Received: from nm3-vm2.bullet.mail.ne1.yahoo.com (nm3-vm2.bullet.mail.ne1.yahoo.com [98.138.91.19]) by mx1.freebsd.org (Postfix) with SMTP id A962F8FC18 for ; Thu, 17 May 2012 15:51:29 +0000 (UTC) Received: from [98.138.90.52] by nm3.bullet.mail.ne1.yahoo.com with NNFMP; 17 May 2012 15:44:34 -0000 Received: from [98.138.226.63] by tm5.bullet.mail.ne1.yahoo.com with NNFMP; 17 May 2012 15:44:34 -0000 Received: from [127.0.0.1] by smtp214.mail.ne1.yahoo.com with NNFMP; 17 May 2012 15:44:33 -0000 X-Yahoo-Newman-Id: 974815.37195.bm@smtp214.mail.ne1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: 9S.klaEVM1mz9Tf8XNLidcKpoJdz4c2WpBpjM.rr0YmMGc_ c8ROE3uKHvOtSw6f.ajgKUbqTf5ejBYgIuPOSZh_KP23vZFr_2jb9uydfE4_ hD7RGvGL8aboU1l9IsO8cImP4emSHvVjWbojf22UJFtlTK_p2jcBeih3xPW1 _ppvzf2cjO.AzBXtOMupkPL5_idLvO8WG9RYaT9Lqwt8ezkWrAv.ZGzzxXja FBiA94phwP.xeRiAw2tMRr9YFNdYQpGbR81OxAMi_wT6t8s0h0rq6F_Ad7mn LU03kuM145FDT_HPnTBQBzOxC8cQR6aoVsr0Gp6EOeuPpk7Lixwmp0HmwNen MwmL0LlaNR63gBx3fkoDOl.DIpLjS5rx23a41JqnAaYm4m5bRNyeLRHYQmc5 spOykESWpo_1QIUakE66CBCDIUSfBjo43o6Bf8lxsUeMsqP4WqACRIUuWCEz 65wJhiDkQ8e_id8Q0IaTF3TfhZ6hSC4rGkTE8mb9guurJZsyrZTn2QSAm.6K VqmNzSA-- X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Received: from [192.168.10.103] (pfg@200.118.157.7 with plain) by smtp214.mail.ne1.yahoo.com with SMTP; 17 May 2012 08:44:33 -0700 PDT Message-ID: <4FB51CDF.3040306@FreeBSD.org> Date: Thu, 17 May 2012 10:44:31 -0500 From: Pedro Giffuni User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:10.0.3) Gecko/20120328 Thunderbird/10.0.3 MIME-Version: 1.0 To: freebsd-current@FreeBSD.org, freebsd-toolchain@FreeBSD.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Subject: GCC update for testing X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2012 15:51:30 -0000 Hi; I took a bunch of patches that were merged into the GCC 4.1 branch (under GPLv2) and prepared a patch for merging them into our base gcc. These are supposed to be bug fixes only. You can get the patch here: http://people.freebsd.org/~pfg/patches/patch-contrib-gcc And, for those really interested, the log is here: http://people.freebsd.org/~pfg/patches/gcc41-pr-log It may be my imagination but the patch seems to be causing more warnings than usual and it breaks the kernel here: ____ $ make cc -c -O2 -Os -pipe -fno-strict-aliasing -march=athlon64 -std=c99 -g -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef -Wno-pointer-sign -fformat-extensions -Wmissing-include-dirs -fdiagnostics-show-option -nostdinc -I. -I../../.. -I../../../contrib/altq -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -fno-common -finline-limit=8000 --param inline-unit-growth=100 --param large-function-growth=1000 -fno-omit-frame-pointer -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -msoft-float -fno-asynchronous-unwind-tables -ffreestanding -fstack-protector -Werror ../../../cam/scsi/scsi_sa.c cc1: warnings being treated as errors ../../../cam/scsi/scsi_sa.c: In function 'samount': ../../../cam/scsi/scsi_sa.c:1887: warning: 'comp_supported' may be used uninitialized in this function ../../../cam/scsi/scsi_sa.c:1888: warning: 'write_protect' may be used uninitialized in this function ../../../cam/scsi/scsi_sa.c:1887: warning: 'comp_enabled' may be used uninitialized in this function ../../../cam/scsi/scsi_sa.c:2728: warning: 'current_speed' may be used uninitialized in this function ../../../cam/scsi/scsi_sa.c:2728: note: 'current_speed' was declared here ../../../cam/scsi/scsi_sa.c:2727: warning: 'current_density' may be used uninitialized in this function ../../../cam/scsi/scsi_sa.c:2727: note: 'current_density' was declared here ../../../cam/scsi/scsi_sa.c:2725: warning: 'current_blocksize' may be used uninitialized in this function ../../../cam/scsi/scsi_sa.c:2725: note: 'current_blocksize' was declared here ../../../cam/scsi/scsi_sa.c:2728: warning: 'current_speed' may be used uninitialized in this function ../../../cam/scsi/scsi_sa.c:2728: note: 'current_speed' was declared here ../../../cam/scsi/scsi_sa.c:2725: warning: 'current_blocksize' may be used uninitialized in this function ../../../cam/scsi/scsi_sa.c:2725: note: 'current_blocksize' was declared here ../../../cam/scsi/scsi_sa.c:2728: warning: 'current_speed' may be used uninitialized in this function ../../../cam/scsi/scsi_sa.c:2728: note: 'current_speed' was declared here ../../../cam/scsi/scsi_sa.c:2725: warning: 'current_blocksize' may be used uninitialized in this function ../../../cam/scsi/scsi_sa.c:2725: note: 'current_blocksize' was declared here ../../../cam/scsi/scsi_sa.c:2728: warning: 'current_speed' may be used uninitialized in this function ../../../cam/scsi/scsi_sa.c:2728: note: 'current_speed' was declared here ../../../cam/scsi/scsi_sa.c:2725: warning: 'current_blocksize' may be used uninitialized in this function ../../../cam/scsi/scsi_sa.c:2725: note: 'current_blocksize' was declared here *** Error code 1 ... ____ Other stuff I tested (Apache OpenOffice) builds fine. cheers, Pedro. From owner-freebsd-toolchain@FreeBSD.ORG Thu May 17 16:44:53 2012 Return-Path: Delivered-To: freebsd-toolchain@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 099451065674; Thu, 17 May 2012 16:44:53 +0000 (UTC) (envelope-from dimitry@andric.com) Received: from springbank.echomania.com (andric.com [IPv6:2001:888:2003:1001:230:48ff:fe51:76b6]) by mx1.freebsd.org (Postfix) with ESMTP id 762D78FC0A; Thu, 17 May 2012 16:44:49 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at springbank.echomania.com Received: from [192.168.1.6] (tensor.andric.com [87.251.56.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by springbank.echomania.com (Postfix) with ESMTPSA id CCD50A7071; Thu, 17 May 2012 18:44:26 +0200 (CEST) Message-ID: <4FB52AF9.1010306@andric.com> Date: Thu, 17 May 2012 18:44:41 +0200 From: Dimitry Andric User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:13.0) Gecko/20120425 Thunderbird/13.0 MIME-Version: 1.0 To: Pedro Giffuni References: <4FB51CDF.3040306@FreeBSD.org> In-Reply-To: <4FB51CDF.3040306@FreeBSD.org> X-Enigmail-Version: 1.5a1pre Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-current@FreeBSD.org, freebsd-toolchain@FreeBSD.org Subject: Re: GCC update for testing X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2012 16:44:53 -0000 On 2012-05-17 17:44, Pedro Giffuni wrote:> Hi; > I took a bunch of patches that were merged into the GCC 4.1 branch > (under GPLv2) and prepared a patch for merging them into our base > gcc. These are supposed to be bug fixes only. > > You can get the patch here: > http://people.freebsd.org/~pfg/patches/patch-contrib-gcc > And, for those really interested, the log is here: > http://people.freebsd.org/~pfg/patches/gcc41-pr-log > > It may be my imagination but the patch seems to be causing more > warnings than usual and it breaks the kernel here: ... > ../../../cam/scsi/scsi_sa.c: In function 'samount': > ../../../cam/scsi/scsi_sa.c:1887: warning: 'comp_supported' may be used > uninitialized in this function > ../../../cam/scsi/scsi_sa.c:1888: warning: 'write_protect' may be used > uninitialized in this function These warnings seem wrong, upon casual inspection of the code. In any case, if you compile the same file with gcc 4.7, they don't appear. :) Any idea which particular gcc fix is responsible for them? As a workaround, we could set all those variable to some reasonable value, but that feels like a cheap trick to me... But I'd rather just not import the fix that causes those warnings. From owner-freebsd-toolchain@FreeBSD.ORG Thu May 17 19:23:41 2012 Return-Path: Delivered-To: freebsd-toolchain@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F081E1065670 for ; Thu, 17 May 2012 19:23:41 +0000 (UTC) (envelope-from pfg@freebsd.org) Received: from nm27-vm2.bullet.mail.ne1.yahoo.com (nm27-vm2.bullet.mail.ne1.yahoo.com [98.138.91.215]) by mx1.freebsd.org (Postfix) with SMTP id 744E58FC0A for ; Thu, 17 May 2012 19:23:41 +0000 (UTC) Received: from [98.138.90.48] by nm27.bullet.mail.ne1.yahoo.com with NNFMP; 17 May 2012 19:23:35 -0000 Received: from [98.138.84.47] by tm1.bullet.mail.ne1.yahoo.com with NNFMP; 17 May 2012 19:23:35 -0000 Received: from [127.0.0.1] by smtp115.mail.ne1.yahoo.com with NNFMP; 17 May 2012 19:23:35 -0000 X-Yahoo-Newman-Id: 599928.26148.bm@smtp115.mail.ne1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: Vhm8ZTEVM1klTadLKjcbXxAvzbtcV0iCtTFuoME_9AqYcqP iHcUBmF3BFByfD7FnP.cWD_d0y4WxmwplM5VR4KzgH53dAPgBQQSajBavkl2 Pk_ySUS_Jf19RpbTqc1Ya2FhIxkOb3sb632dWvvJIbnm5GiIDSsfPtVl.Jz8 p_tnn5g0imsB2lGcJl42Js_NmLRNE4IERU6ilrQetQDuU.GVxYF2V7miQDhE 4gi905.qcBcy1l3.I0FkYVL9_5E83kuKwJX1McuHun1bEzgd70qCR5LcCg5p lVu_tj8XLKrjp.Jy6h8sMZDwqYznJA1gBp5Y_Dz.unHBOHue0eMZGPqsbR7n uvVmUbn67OR.njI6g9tXshNa83wGLxLZzJ2tBiYKs7BofA4ZEWHIxPXX8YiV dUmFEuz835cOSewIfnhHi_UmjAznWzE5T6_7dXiNqyyHwsD4Vm2jmN5Z389x U3BKVP5e18B5_EiiVkmOFjbRIIivycax7scZOiNNY7l.Vv0TumUurzFTPhCb irzHTqQ-- X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Received: from [192.168.10.103] (pfg@200.118.157.7 with plain) by smtp115.mail.ne1.yahoo.com with SMTP; 17 May 2012 12:23:35 -0700 PDT Message-ID: <4FB55034.2080404@FreeBSD.org> Date: Thu, 17 May 2012 14:23:32 -0500 From: Pedro Giffuni User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:10.0.3) Gecko/20120328 Thunderbird/10.0.3 MIME-Version: 1.0 To: Dimitry Andric References: <4FB51CDF.3040306@FreeBSD.org> <4FB52AF9.1010306@andric.com> In-Reply-To: <4FB52AF9.1010306@andric.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-current@FreeBSD.org, freebsd-toolchain@FreeBSD.org Subject: Re: GCC update for testing X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2012 19:23:42 -0000 Hi Dimitry; On 05/17/12 11:44, Dimitry Andric wrote: > On 2012-05-17 17:44, Pedro Giffuni wrote:> Hi; >> I took a bunch of patches that were merged into the GCC 4.1 branch >> (under GPLv2) and prepared a patch for merging them into our base >> gcc. These are supposed to be bug fixes only. >> >> You can get the patch here: >> http://people.freebsd.org/~pfg/patches/patch-contrib-gcc >> And, for those really interested, the log is here: >> http://people.freebsd.org/~pfg/patches/gcc41-pr-log >> >> It may be my imagination but the patch seems to be causing more >> warnings than usual and it breaks the kernel here: > ... >> ../../../cam/scsi/scsi_sa.c: In function 'samount': >> ../../../cam/scsi/scsi_sa.c:1887: warning: 'comp_supported' may be used >> uninitialized in this function >> ../../../cam/scsi/scsi_sa.c:1888: warning: 'write_protect' may be used >> uninitialized in this function > These warnings seem wrong, upon casual inspection of the code. In any > case, if you compile the same file with gcc 4.7, they don't appear. :) > > Any idea which particular gcc fix is responsible for them? > > As a workaround, we could set all those variable to some reasonable > value, but that feels like a cheap trick to me... > > But I'd rather just not import the fix that causes those warnings. I will have to dig deeper into the changes to see what causes this. In any case I do agree and the patch will not be committed. Ultimately I can just leave the list around and we bring them in only as needed. Pedro. From owner-freebsd-toolchain@FreeBSD.ORG Fri May 18 07:08:58 2012 Return-Path: Delivered-To: freebsd-toolchain@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2AA27106566B; Fri, 18 May 2012 07:08:58 +0000 (UTC) (envelope-from gleb.kurtsou@gmail.com) Received: from mail-lpp01m010-f54.google.com (mail-lpp01m010-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id 39E8C8FC0A; Fri, 18 May 2012 07:08:57 +0000 (UTC) Received: by laai10 with SMTP id i10so2600169laa.13 for ; Fri, 18 May 2012 00:08:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=X8L9RH6HBQMnVRGOueaFjiU3nYL4QOrjNzzNCbtGdz0=; b=MG1O02tOInQuRcQBPTBnWZZaOACt6nuW47uM7M35AXzHqqU/oVmRCyamRuBESToCuU 0aQdEbByZSSDWbSs1NR+64i39eao1NLxy40ZBxyX29POo3SE9TENy2/ziWQyJElls3c1 fyG9/iqYYFNr+2tZuW/Y45wfRfSglINST2CokH3FBpT89qmLpP0TzI3QYMHnfu5AtJPI XovkK4TTfMZR1DVKcPprm+WiJMN3rVDsC6lP0W0ALbE+IyzMnggBCb+MIjASd+YH9k/1 8AuDwB4vhOih07mDs8n5l9pvgsVXIn1AGEdwmpSopnMnf+jb1rjU+Lrgsav9fvyv/21W BXIQ== Received: by 10.112.24.194 with SMTP id w2mr4262068lbf.75.1337324935801; Fri, 18 May 2012 00:08:55 -0700 (PDT) Received: from localhost ([78.157.92.5]) by mx.google.com with ESMTPS id gv8sm11154210lab.14.2012.05.18.00.08.46 (version=SSLv3 cipher=OTHER); Fri, 18 May 2012 00:08:54 -0700 (PDT) Date: Fri, 18 May 2012 10:08:46 +0300 From: Gleb Kurtsou To: Pedro Giffuni Message-ID: <20120518070846.GB1071@reks> References: <4FB51CDF.3040306@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <4FB51CDF.3040306@FreeBSD.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: freebsd-current@FreeBSD.org, freebsd-toolchain@FreeBSD.org Subject: Re: GCC update for testing X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 May 2012 07:08:58 -0000 On (17/05/2012 10:44), Pedro Giffuni wrote: > Hi; > > I took a bunch of patches that were merged into the GCC 4.1 branch > (under GPLv2) and prepared a patch for merging them into our base > gcc. These are supposed to be bug fixes only. > > You can get the patch here: > http://people.freebsd.org/~pfg/patches/patch-contrib-gcc > And, for those really interested, the log is here: > http://people.freebsd.org/~pfg/patches/gcc41-pr-log Could you check if patch fixes this issue: http://marc.info/?l=freebsd-hackers&m=132348021530691&w=2 I've disabled gcc from base locally since discovering it. Thanks, Gleb. > It may be my imagination but the patch seems to be causing more > warnings than usual and it breaks the kernel here: > > ____ > $ make > cc -c -O2 -Os -pipe -fno-strict-aliasing -march=athlon64 -std=c99 -g > -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes > -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef > -Wno-pointer-sign -fformat-extensions -Wmissing-include-dirs > -fdiagnostics-show-option -nostdinc -I. -I../../.. > -I../../../contrib/altq -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include > opt_global.h -fno-common -finline-limit=8000 --param > inline-unit-growth=100 --param large-function-growth=1000 > -fno-omit-frame-pointer -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse > -msoft-float -fno-asynchronous-unwind-tables -ffreestanding > -fstack-protector -Werror ../../../cam/scsi/scsi_sa.c > cc1: warnings being treated as errors > ../../../cam/scsi/scsi_sa.c: In function 'samount': > ../../../cam/scsi/scsi_sa.c:1887: warning: 'comp_supported' may be used > uninitialized in this function > ../../../cam/scsi/scsi_sa.c:1888: warning: 'write_protect' may be used > uninitialized in this function > ../../../cam/scsi/scsi_sa.c:1887: warning: 'comp_enabled' may be used > uninitialized in this function > ../../../cam/scsi/scsi_sa.c:2728: warning: 'current_speed' may be used > uninitialized in this function > ../../../cam/scsi/scsi_sa.c:2728: note: 'current_speed' was declared here > ../../../cam/scsi/scsi_sa.c:2727: warning: 'current_density' may be used > uninitialized in this function > ../../../cam/scsi/scsi_sa.c:2727: note: 'current_density' was declared here > ../../../cam/scsi/scsi_sa.c:2725: warning: 'current_blocksize' may be > used uninitialized in this function > ../../../cam/scsi/scsi_sa.c:2725: note: 'current_blocksize' was declared > here > ../../../cam/scsi/scsi_sa.c:2728: warning: 'current_speed' may be used > uninitialized in this function > ../../../cam/scsi/scsi_sa.c:2728: note: 'current_speed' was declared here > ../../../cam/scsi/scsi_sa.c:2725: warning: 'current_blocksize' may be > used uninitialized in this function > ../../../cam/scsi/scsi_sa.c:2725: note: 'current_blocksize' was declared > here > ../../../cam/scsi/scsi_sa.c:2728: warning: 'current_speed' may be used > uninitialized in this function > ../../../cam/scsi/scsi_sa.c:2728: note: 'current_speed' was declared here > ../../../cam/scsi/scsi_sa.c:2725: warning: 'current_blocksize' may be > used uninitialized in this function > ../../../cam/scsi/scsi_sa.c:2725: note: 'current_blocksize' was declared > here > ../../../cam/scsi/scsi_sa.c:2728: warning: 'current_speed' may be used > uninitialized in this function > ../../../cam/scsi/scsi_sa.c:2728: note: 'current_speed' was declared here > ../../../cam/scsi/scsi_sa.c:2725: warning: 'current_blocksize' may be > used uninitialized in this function > ../../../cam/scsi/scsi_sa.c:2725: note: 'current_blocksize' was declared > here > *** Error code 1 > ... > ____ > > Other stuff I tested (Apache OpenOffice) builds fine. > > cheers, > > Pedro. > _______________________________________________ > freebsd-current@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org" From owner-freebsd-toolchain@FreeBSD.ORG Fri May 18 15:58:41 2012 Return-Path: Delivered-To: freebsd-toolchain@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A08861065784 for ; Fri, 18 May 2012 15:58:41 +0000 (UTC) (envelope-from pfg@freebsd.org) Received: from nm19-vm0.bullet.mail.sp2.yahoo.com (nm19-vm0.bullet.mail.sp2.yahoo.com [98.139.91.216]) by mx1.freebsd.org (Postfix) with SMTP id 7AA158FC16 for ; Fri, 18 May 2012 15:58:41 +0000 (UTC) Received: from [98.139.91.63] by nm19.bullet.mail.sp2.yahoo.com with NNFMP; 18 May 2012 15:58:40 -0000 Received: from [208.71.42.201] by tm3.bullet.mail.sp2.yahoo.com with NNFMP; 18 May 2012 15:58:40 -0000 Received: from [127.0.0.1] by smtp212.mail.gq1.yahoo.com with NNFMP; 18 May 2012 15:58:40 -0000 X-Yahoo-Newman-Id: 859341.55624.bm@smtp212.mail.gq1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: MME.y.MVM1ktI5roD7EFMOMCrBusbz8xcpLbSRz66TOFGtd LpjAvUCc9lLC4DbZBYZhwexBi2O2dPUPSXt2.H4HseAqAOj6depN7NU8fWuC K8hoXVRDcGjq1JuRb2Klkh_Qs7aGTtZZ4y9EmknvInOCkTidwvdUpKHEM7Ny mL37ZVUKqmGgViE3pRUbj6A8dp.sQgqhBXrkCTK0L5riaalY6KGJXdVVvJUA Gmfdo50jbw3r3VhCRgg3wzjWrFJdS0Bm0f4C1GK8Ju_1a_rNgvuazyfwPzwT dLKBaLoC65hrNwVn5BxisthzinanST7zfVYaOVS4ZQ8bj0ZD98LXDRBFrKnB 2OWR5MB.imAQIbObXRb5tyB2B1_p3zwYzOtcbFjjF1Lnz8IhQsw_VdtRFG3a L.5rMlduBFpGqV6DlFoW9hjll3u3M.hQSuaOIqILJc0PJ6l1QotiNsh5CKuq GACkZvJnH_z6wr0EFk056.OjtDFT0bIeND2nmWr4HpWmUHZm_Xh8NlmvVVrc 9nj59y4Dp18fmjBxy5e.5OXKevqAfRQfgQsR4TqRVxss4BnCkzHx5g74lPmC e71gnTZBty2JN9Pb3D6t0qN_BoqQ6gbxmMPN2PgUESW9r2YjUlqj0EhM- X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Received: from [192.168.10.103] (pfg@200.118.157.7 with plain) by smtp212.mail.gq1.yahoo.com with SMTP; 18 May 2012 08:58:40 -0700 PDT Message-ID: <4FB671AE.2080601@FreeBSD.org> Date: Fri, 18 May 2012 10:58:38 -0500 From: Pedro Giffuni User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:10.0.3) Gecko/20120328 Thunderbird/10.0.3 MIME-Version: 1.0 To: Gleb Kurtsou References: <4FB51CDF.3040306@FreeBSD.org> <20120518070846.GB1071@reks> In-Reply-To: <20120518070846.GB1071@reks> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-current@FreeBSD.org, freebsd-toolchain@FreeBSD.org Subject: Re: GCC update for testing X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 May 2012 15:58:41 -0000 On 05/18/12 02:08, Gleb Kurtsou wrote: > On (17/05/2012 10:44), Pedro Giffuni wrote: >> Hi; >> >> I took a bunch of patches that were merged into the GCC 4.1 branch >> (under GPLv2) and prepared a patch for merging them into our base >> gcc. These are supposed to be bug fixes only. >> >> You can get the patch here: >> http://people.freebsd.org/~pfg/patches/patch-contrib-gcc >> And, for those really interested, the log is here: >> http://people.freebsd.org/~pfg/patches/gcc41-pr-log > Could you check if patch fixes this issue: > http://marc.info/?l=freebsd-hackers&m=132348021530691&w=2 > > I've disabled gcc from base locally since discovering it. > > Thanks, > Gleb. > No joy :(. Sorry: ./gcc-test1 src2.c:16:test_fail: Assertion failed: addr->sin_addr.s_addr == ntohl(INADDR_ANY) Abort From owner-freebsd-toolchain@FreeBSD.ORG Fri May 18 18:11:47 2012 Return-Path: Delivered-To: freebsd-toolchain@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 229DB1065674 for ; Fri, 18 May 2012 18:11:47 +0000 (UTC) (envelope-from pfg@freebsd.org) Received: from nm10.bullet.mail.bf1.yahoo.com (nm10.bullet.mail.bf1.yahoo.com [98.139.212.169]) by mx1.freebsd.org (Postfix) with SMTP id A9A618FC14 for ; Fri, 18 May 2012 18:11:46 +0000 (UTC) Received: from [98.139.212.145] by nm10.bullet.mail.bf1.yahoo.com with NNFMP; 18 May 2012 18:11:40 -0000 Received: from [98.139.211.198] by tm2.bullet.mail.bf1.yahoo.com with NNFMP; 18 May 2012 18:11:40 -0000 Received: from [127.0.0.1] by smtp207.mail.bf1.yahoo.com with NNFMP; 18 May 2012 18:11:40 -0000 X-Yahoo-Newman-Id: 511778.84696.bm@smtp207.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: 8R4xXCMVM1nII.uBiZw9JBuCAB20WzaEP7EPFmc4FhSHvuF Ps5yoU3bmDiMn4_Bs6JxJ96c1J.Qt6nHi1JzohryJCeJHrcYIAwboRMAf18J CtYQnk36reUek8Qh4rVopML.p_hywny4Ymv2wIGLwmTpYgdjQY8GISXr5wht EdtzuMYortuvIs.9HvGshOJtekqeDxR_K9Gu.2AiMvP4NZ9jA_dt1RaP0F6K 8OrSPx7qMwILmeAHzqti_LYJiOgssAtOJ3_Y.VMYmHoHJy4QrmwJJKNG0GQE b3VTXTXq8HrhxLXLEOFNGSkkePSJ3mdTtcw4OxkByxhGK7GTdvJh7kGrSef_ vVeVwYZc6ZbeT_akN9fL9smFN.8SDEvtsLyS4mHmks0Hgfpcdrfpp0xAfqUX N.J4fVu4AMibz3HB2rabaTUSJpvus4_Dyw3eoUti6CX7du3Vb8aTZP69XrN. T5LDWL3_IYsUEbzO7qTXfh6oGzkhKvfJnRjGjMMGuYWfiqAfRyPpMRR_GTZE 8g8cVoock5A0YZ1FZquAXdH_LNKgxp9i24w-- X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Received: from [192.168.10.103] (pfg@200.118.157.7 with plain) by smtp207.mail.bf1.yahoo.com with SMTP; 18 May 2012 11:11:40 -0700 PDT Message-ID: <4FB690DA.8060203@FreeBSD.org> Date: Fri, 18 May 2012 13:11:38 -0500 From: Pedro Giffuni User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:10.0.3) Gecko/20120328 Thunderbird/10.0.3 MIME-Version: 1.0 To: Dimitry Andric References: <4FB51CDF.3040306@FreeBSD.org> <4FB52AF9.1010306@andric.com> In-Reply-To: <4FB52AF9.1010306@andric.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-current@FreeBSD.org, freebsd-toolchain@FreeBSD.org Subject: Re: GCC update for testing X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 May 2012 18:11:47 -0000 Hi again; On 05/17/12 11:44, Dimitry Andric wrote: > On 2012-05-17 17:44, Pedro Giffuni wrote:> Hi; >> I took a bunch of patches that were merged into the GCC 4.1 branch >> (under GPLv2) and prepared a patch for merging them into our base >> gcc. These are supposed to be bug fixes only. >> >> You can get the patch here: >> http://people.freebsd.org/~pfg/patches/patch-contrib-gcc >> And, for those really interested, the log is here: >> http://people.freebsd.org/~pfg/patches/gcc41-pr-log >> >> It may be my imagination but the patch seems to be causing more >> warnings than usual and it breaks the kernel here: > ... >> ../../../cam/scsi/scsi_sa.c: In function 'samount': >> ../../../cam/scsi/scsi_sa.c:1887: warning: 'comp_supported' may be used >> uninitialized in this function >> ../../../cam/scsi/scsi_sa.c:1888: warning: 'write_protect' may be used >> uninitialized in this function > These warnings seem wrong, upon casual inspection of the code. In any > case, if you compile the same file with gcc 4.7, they don't appear. :) > > Any idea which particular gcc fix is responsible for them? > > As a workaround, we could set all those variable to some reasonable > value, but that feels like a cheap trick to me... > > But I'd rather just not import the fix that causes those warnings. Ugh... It appears the patch was fine after all: the warnings were somehow triggered by optimizations in my /etc/make.conf file. I will test it further before committing. Pedro.