From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1499) id E09EF385B51E; Fri, 17 Mar 2023 14:33:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E09EF385B51E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1679063582; bh=S3wyOuwBcVdF3TjqtzoS4efOoSUJLFlv23Pob2YTxfY=; h=From:To:Subject:Date:From; b=cAKQe0neJnQlZJlZICIaV2HEL+spEoQ0yLe2psW02nfAGTiya7JpXBPWq/EM96H9q jZFhF3MePONOlBMRcDMuh2ZRtaDr6M6mqk9A+nJDk9pvVRk/jjIdiLqSzIChuIBrXh VVN/EcRThX9yvpvzo4yzpa0kSsr+bGZnl9UkQVpY= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Gaius Mulley To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-6737] PR modula2/109032 - message 'compiler checks to force' is too complicated X-Act-Checkin: gcc X-Git-Author: Gaius Mulley X-Git-Refname: refs/heads/master X-Git-Oldrev: 57688950b9328cbb4a9c21eb3199f9132b5119d3 X-Git-Newrev: 6bfb5eae96b65894da1301e966568fdf32bf64d0 Message-Id: <20230317143302.E09EF385B51E@sourceware.org> Date: Fri, 17 Mar 2023 14:33:02 +0000 (GMT) List-Id: https://gcc.gnu.org/g:6bfb5eae96b65894da1301e966568fdf32bf64d0 commit r13-6737-g6bfb5eae96b65894da1301e966568fdf32bf64d0 Author: Gaius Mulley Date: Fri Mar 17 14:32:22 2023 +0000 PR modula2/109032 - message 'compiler checks to force' is too complicated Correct typos and improve the descriptions of command line options. Improve comments in gm2-gcc/m2expr.cc. gcc/m2/ChangeLog: PR modula2/109032 * gm2-gcc/m2expr.cc: Correct ? : order in comments. (m2expr_BuildDivM2): Improve comment. * lang.opt: Improve option descriptions. Signed-off-by: Gaius Mulley Diff: --- gcc/m2/gm2-gcc/m2expr.cc | 17 ++++++++++------- gcc/m2/lang.opt | 10 +++++----- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/gcc/m2/gm2-gcc/m2expr.cc b/gcc/m2/gm2-gcc/m2expr.cc index 920cbaaa9bb..0470f7c7f8f 100644 --- a/gcc/m2/gm2-gcc/m2expr.cc +++ b/gcc/m2/gm2-gcc/m2expr.cc @@ -3617,8 +3617,9 @@ m2expr_BuildCap (location_t location, tree t) return error_mark_node; } -/* BuildDivM2 if iso or pim4 then build and return ((op2 < 0) : (op1 - divceil op2) ? (op1 divfloor op2)) otherwise use divtrunc. */ +/* BuildDivM2 if iso or pim4 then all modulus results are positive + and the results from the division are rounded to the floor otherwise + use BuildDivTrunc. */ tree m2expr_BuildDivM2 (location_t location, tree op1, tree op2, @@ -3627,6 +3628,8 @@ m2expr_BuildDivM2 (location_t location, tree op1, tree op2, op1 = m2expr_FoldAndStrip (op1); op2 = m2expr_FoldAndStrip (op2); ASSERT_CONDITION (TREE_TYPE (op1) == TREE_TYPE (op2)); + /* If iso or pim4 then build and return ((op2 < 0) ? (op1 + divceil op2) : (op1 divfloor op2)) otherwise use divtrunc. */ if (M2Options_GetPIM4 () || M2Options_GetISO () || M2Options_GetPositiveModFloor ()) return fold_build3 ( @@ -3642,7 +3645,7 @@ m2expr_BuildDivM2 (location_t location, tree op1, tree op2, } /* BuildDivM2Check - build and - return ((op2 < 0) : (op1 divtrunc op2) ? (op1 divfloor op2)) + return ((op2 < 0) ? (op1 divtrunc op2) : (op1 divfloor op2)) when -fiso, -fpim4 or -fpositive-mod-floor-div is present else return op1 div trunc op2. Use the checking div equivalents. */ @@ -3685,8 +3688,8 @@ m2expr_BuildISOModM2Check (location_t location, } -/* BuildModM2Check if iso or pim4 then build and return ((op2 < 0) : (op1 - modceil op2) ? (op1 modfloor op2)) otherwise use modtrunc. +/* BuildModM2Check if iso or pim4 then build and return ((op2 < 0) ? (op1 + modceil op2) : (op1 modfloor op2)) otherwise use modtrunc. Use the checking mod equivalents. */ tree @@ -3703,8 +3706,8 @@ m2expr_BuildModM2Check (location_t location, tree op1, tree op2, return m2expr_BuildModTruncCheck (location, op1, op2, lowest, min, max); } -/* BuildModM2 if iso or pim4 then build and return ((op2 < 0) : (op1 - modceil op2) ? (op1 modfloor op2)) otherwise use modtrunc. */ +/* BuildModM2 if iso or pim4 then build and return ((op2 < 0) ? (op1 + modceil op2) : (op1 modfloor op2)) otherwise use modtrunc. */ tree m2expr_BuildModM2 (location_t location, tree op1, tree op2, diff --git a/gcc/m2/lang.opt b/gcc/m2/lang.opt index 691a75f2e4e..4d54a16b3e2 100644 --- a/gcc/m2/lang.opt +++ b/gcc/m2/lang.opt @@ -56,7 +56,7 @@ turns on runtime subrange, array index and indirection via NIL pointer checking fcase Modula-2 -turns on runtime checking to check whether a CASE statement requires an ELSE clause when on was not specified +turns on runtime checking to check whether a CASE statement requires an ELSE clause when one was not specified fcpp Modula-2 @@ -104,7 +104,7 @@ allows opaque types to be implemented as any type (a GNU Modula-2 extension) ffloatvalue Modula-2 -turns on runtime checking to check whether a floating point number is about to exceed range +turns on runtime checking to check whether a floating point number will exceed range fgen-module-list= Modula-2 Joined @@ -120,7 +120,7 @@ use ISO dialect of Modula-2 flibs= Modula-2 Joined -specify the library order, currently legal entries include: log, min, pim, iso or their directory name equivalent m2log, m2min, m2pim, m2iso. +specify the library order, the libraries maybe specified by a comma separated abbreviation: log,min,pim,iso or by directory names: m2log,m2min,m2pim,m2iso. flocation= Modula-2 Joined @@ -212,7 +212,7 @@ specify the list of runtime modules and their initialization order fscaffold-dynamic Modula-2 -the modules initialization order is dynamically determined by M2RTS and application dependancies +the modules initialization order is dynamically determined by M2RTS and application dependencies fscaffold-c Modula-2 @@ -264,7 +264,7 @@ turns on all division and modulus by zero checking for ordinal values fwholevalue Modula-2 -turns on runtime checking to check whether a whole number is about to exceed range +turns on runtime checking to check whether a whole number will exceed range static-libgm2 Driver