From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from aserp2120.oracle.com (aserp2120.oracle.com [141.146.126.78]) by sourceware.org (Postfix) with ESMTPS id 9CF63395B08F for ; Thu, 23 Apr 2020 19:52:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 9CF63395B08F Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 03NJmdQY134295; Thu, 23 Apr 2020 19:52:53 GMT Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by aserp2120.oracle.com with ESMTP id 30jvq4wm3c-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 23 Apr 2020 19:52:53 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 03NJfbib033981; Thu, 23 Apr 2020 19:52:53 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userp3020.oracle.com with ESMTP id 30k7qvr115-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 23 Apr 2020 19:52:52 +0000 Received: from abhmp0014.oracle.com (abhmp0014.oracle.com [141.146.116.20]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 03NJqqMt024714; Thu, 23 Apr 2020 19:52:52 GMT Received: from dhcp-10-154-119-182.vpn.oracle.com (/10.154.119.182) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 23 Apr 2020 12:52:51 -0700 Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Re: [Version 2][PATCH][gcc][PR94230]provide an option to change the size limitation for -Wmisleading-indent From: Qing Zhao In-Reply-To: Date: Thu, 23 Apr 2020 14:52:49 -0500 Cc: "dmalcolm@redhat.com" , Qing Zhao via Gcc-patches Content-Transfer-Encoding: quoted-printable Message-Id: <55A246C1-106D-48E2-B369-468F19E4E326@ORACLE.COM> References: <616B2BE0-0C66-4736-90E5-ECAD1FA4F8AD@ORACLE.COM> <47B8948D-C9BA-41EC-B55B-AF8117E79C50@ORACLE.COM> <8D4865D1-209A-491C-A265-E630E42406DE@ORACLE.COM> To: Richard Sandiford X-Mailer: Apple Mail (2.3445.104.11) X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9600 signatures=668686 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 spamscore=0 mlxlogscore=999 adultscore=0 suspectscore=3 bulkscore=0 phishscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2004230147 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9600 signatures=668686 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 lowpriorityscore=0 malwarescore=0 mlxscore=0 adultscore=0 mlxlogscore=999 phishscore=0 impostorscore=0 clxscore=1015 bulkscore=0 spamscore=0 priorityscore=1501 suspectscore=3 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2004230147 X-Spam-Status: No, score=-16.3 required=5.0 tests=BAYES_00, BODY_8BITS, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_HELO_PASS, SPF_PASS, TXREP, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Apr 2020 19:52:59 -0000 Hi, Richard, > On Apr 23, 2020, at 1:27 PM, Richard Sandiford = wrote: >=20 > Qing Zhao writes: >> --- >> gcc/c-family/c-indentation.c | 3 +++ >> gcc/common.opt | 5 +++++ >> gcc/doc/invoke.texi | 15 = ++++++++++++++- >> gcc/testsuite/gcc.dg/plugin/location-overflow-test-1.c | 2 +- >> gcc/toplev.c | 3 +++ >> 5 files changed, 26 insertions(+), 2 deletions(-) >>=20 >> diff --git a/gcc/c-family/c-indentation.c = b/gcc/c-family/c-indentation.c >> index f737555..7074b10 100644 >> --- a/gcc/c-family/c-indentation.c >> +++ b/gcc/c-family/c-indentation.c >> @@ -67,6 +67,9 @@ get_visual_column (expanded_location exploc, = location_t loc, >> "%<-Wmisleading-indentation%> is disabled from this = point" >> " onwards, since column-tracking was disabled due to" >> " the size of the code/headers"); >> + inform (loc, >> + "please add %<-flarge-source-files%> to invoke more"=20= >> + " column-tracking for large source files"); >> } >> return false; >> } >=20 > This should be conditional on !flag_large_source_files. Yes, indeed, will add it. >=20 >> diff --git a/gcc/common.opt b/gcc/common.opt >> index 4368910..10a3d5b 100644 >> --- a/gcc/common.opt >> +++ b/gcc/common.opt >> @@ -1597,6 +1597,11 @@ fkeep-gc-roots-live >> Common Undocumented Report Var(flag_keep_gc_roots_live) Optimization >> ; Always keep a pointer to a live memory block >>=20 >> +flarge-source-files >> +Common Report Var(flag_large_source_files) Init(0) >> +Adjust GCC to cope with large source files to provide more accurate >> +column information. >> + >=20 > I'm having difficulty suggesting wording here, but I think would be = good > to mention the downside. How about: >=20 > ---------------------- > Improve GCC's ability to track column numbers in large source files, > at the expense of slower compilation. > =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94= =E2=80=94=E2=80=94=E2=80=94 Sounds better than my previous wording. Thanks. >=20 >> floop-parallelize-all >> Common Report Var(flag_loop_parallelize_all) Optimization >> Mark all loops as parallel. >> diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi >> index 96a9516..c6ea9ef 100644 >> --- a/gcc/doc/invoke.texi >> +++ b/gcc/doc/invoke.texi >> @@ -574,7 +574,7 @@ Objective-C and Objective-C++ Dialects}. >> -fdebug-cpp -fdirectives-only -fdollars-in-identifiers @gol >> -fexec-charset=3D@var{charset} -fextended-identifiers @gol >> -finput-charset=3D@var{charset} = -fmacro-prefix-map=3D@var{old}=3D@var{new} @gol >> --fmax-include-depth=3D@var{depth} @gol >> +-fmax-include-depth=3D@var{depth} -flarge-source-files @gol >> -fno-canonical-system-headers -fpch-deps -fpch-preprocess @gol >> -fpreprocessed -ftabstop=3D@var{width} -ftrack-macro-expansion = @gol >> -fwide-exec-charset=3D@var{charset} -fworking-directory @gol >=20 > This should be kept in alphabetical order, so after -finput-charset. Okay.=20 >=20 >> @@ -14151,6 +14151,19 @@ This option may be useful in conjunction = with the @option{-B} or >> perform additional processing of the program source between >> normal preprocessing and compilation. >>=20 >> +@item -flarge-source-files >> +@opindex flarge-source-files >> +Adjust GCC to cope with large source files to provide more accurate >> +column information.=20 >> +By default, GCC will lose accurate column information if the source=20= >> +file is very large. >> +If this option is provided, GCC will adapt accordingly to provide = more >> +accurate column information.=20 >> +This option may be useful when any user hits the = @option{-Wmisleading-indent}=20 >> +note, "is disabled from this point onwards, since column-tracking = was disabled=20 >> +due to the size of the code/headers", or hits the limit at which = columns get >> +dropped from diagnostics. >> + >=20 > On a similar vein, how about: >=20 > ---------------------- > Adjust GCC to expect large source files, at the expense of slower > compilation and higher memory usage. >=20 > Specifically, GCC normally tracks both column numbers and line numbers > within source files and it normally prints both of these numbers in > diagnostics. However, once it has processed a certain number of = source > lines, it stops tracking column numbers and only tracks line numbers. > This means that diagnostics for later lines do not include column = numbers. > It also means that options like @option{-Wmisleading-indent} cease to = work > at that point, although the compiler prints a note if this happens. > Passing @option{-flarge-source-files} significantly increases the = number > of source lines that GCC can process before it stops tracking column > numbers. > =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94= =E2=80=94=E2=80=94=E2=80=94 Thanks a lot for this paragraph. I will use it. Qing >=20 > Thanks, > Richard