* [PATCH] [ARC][COMMITTED] Fix diagnostic messages. @ 2019-04-17 11:14 Claudiu Zissulescu 2019-04-17 11:27 ` Jakub Jelinek 0 siblings, 1 reply; 5+ messages in thread From: Claudiu Zissulescu @ 2019-04-17 11:14 UTC (permalink / raw) To: gcc-patches; +Cc: andrew.burgess, fbedard Apply upper/dot rule on diagnostic messages. gcc/ xxxx-xx-xx Claudiu Zissulescu <claziss@synopsys.com> * config/arc/arc.c (arc_init): Format diagnostic string. (arc_override_options): Likewise. (check_if_valid_regno_const): Likewise. (arc_reorg): Likewise. --- gcc/ChangeLog | 7 +++++++ gcc/config/arc/arc.c | 22 ++++++++++++---------- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9480e693c08..3820fae8ee7 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2019-04-17 Claudiu Zissulescu <claziss@synopsys.com> + + * config/arc/arc.c (arc_init): Format diagnostic string. + (arc_override_options): Likewise. + (check_if_valid_regno_const): Likewise. + (arc_reorg): Likewise. + 2019-04-17 Segher Boessenkool <segher@kernel.crashing.org> PR target/17108 diff --git a/gcc/config/arc/arc.c b/gcc/config/arc/arc.c index 65eef30747a..1a04f9ef793 100644 --- a/gcc/config/arc/arc.c +++ b/gcc/config/arc/arc.c @@ -950,13 +950,13 @@ arc_init (void) /* FPX-4. No FPX extensions mixed with FPU extensions. */ if ((TARGET_DPFP_FAST_SET || TARGET_DPFP_COMPACT_SET || TARGET_SPFP) && TARGET_HARD_FLOAT) - error ("No FPX/FPU mixing allowed"); + error ("no FPX/FPU mixing allowed"); /* Warn for unimplemented PIC in pre-ARC700 cores, and disable flag_pic. */ if (flag_pic && TARGET_ARC600_FAMILY) { warning (0, - "PIC is not supported for %s. Generating non-PIC code only..", + "PIC is not supported for %s. Generating non-PIC code only", arc_cpu_string); flag_pic = 0; } @@ -1222,26 +1222,26 @@ arc_override_options (void) do { \ if ((!(arc_selected_cpu->arch_info->flags & CODE)) \ && (VAR == VAL)) \ - error ("Option %s=%s is not available for %s CPU.", \ + error ("option %s=%s is not available for %s CPU", \ DOC0, DOC1, arc_selected_cpu->name); \ if ((arc_selected_cpu->arch_info->dflags & CODE) \ && (VAR != DEFAULT_##VAR) \ && (VAR != VAL)) \ - warning (0, "Option %s is ignored, the default value %s" \ - " is considered for %s CPU.", DOC0, DOC1, \ + warning (0, "option %s is ignored, the default value %s" \ + " is considered for %s CPU", DOC0, DOC1, \ arc_selected_cpu->name); \ } while (0); #define ARC_OPT(NAME, CODE, MASK, DOC) \ do { \ if ((!(arc_selected_cpu->arch_info->flags & CODE)) \ && (target_flags & MASK)) \ - error ("Option %s is not available for %s CPU", \ + error ("option %s is not available for %s CPU", \ DOC, arc_selected_cpu->name); \ if ((arc_selected_cpu->arch_info->dflags & CODE) \ && (target_flags_explicit & MASK) \ && (!(target_flags & MASK))) \ - warning (0, "Unset option %s is ignored, it is always" \ - " enabled for %s CPU.", DOC, \ + warning (0, "unset option %s is ignored, it is always" \ + " enabled for %s CPU", DOC, \ arc_selected_cpu->name); \ } while (0); @@ -7268,7 +7268,8 @@ check_if_valid_regno_const (rtx *operands, int opno) case CONST_INT : return true; default: - error ("register number must be a compile-time constant. Try giving higher optimization levels"); + error ("register number must be a compile-time constant. " + "Try giving higher optimization levels"); break; } return false; @@ -8261,7 +8262,8 @@ arc_reorg (void) cfun->machine->ccfsm_current_insn = NULL_RTX; if (!INSN_ADDRESSES_SET_P()) - fatal_error (input_location, "Insn addresses not set after shorten_branches"); + fatal_error (input_location, + "insn addresses not set after shorten_branches"); for (insn = get_insns (); insn; insn = NEXT_INSN (insn)) { -- 2.20.1 ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] [ARC][COMMITTED] Fix diagnostic messages. 2019-04-17 11:14 [PATCH] [ARC][COMMITTED] Fix diagnostic messages Claudiu Zissulescu @ 2019-04-17 11:27 ` Jakub Jelinek 2019-04-17 19:28 ` Marek Polacek 2019-04-24 9:20 ` [PATCH] [ARC][COMMITTED] Fix diagnostic messages Claudiu Zissulescu 0 siblings, 2 replies; 5+ messages in thread From: Jakub Jelinek @ 2019-04-17 11:27 UTC (permalink / raw) To: Claudiu Zissulescu; +Cc: gcc-patches, andrew.burgess, fbedard On Wed, Apr 17, 2019 at 02:09:33PM +0300, Claudiu Zissulescu wrote: > /* Warn for unimplemented PIC in pre-ARC700 cores, and disable flag_pic. */ > if (flag_pic && TARGET_ARC600_FAMILY) > { > warning (0, > - "PIC is not supported for %s. Generating non-PIC code only..", > + "PIC is not supported for %s. Generating non-PIC code only", > arc_cpu_string); I believe this is undesirable too. Either use something like "PIC is not supported for %s; generating non-PIC code only" or split that into two messages if (warning (0, "PIC is not supported for %s", arc_cpu_string)) inform (input_location, "generating non-PIC code only"); > @@ -1222,26 +1222,26 @@ arc_override_options (void) > do { \ > if ((!(arc_selected_cpu->arch_info->flags & CODE)) \ > && (VAR == VAL)) \ > - error ("Option %s=%s is not available for %s CPU.", \ > + error ("option %s=%s is not available for %s CPU", \ > DOC0, DOC1, arc_selected_cpu->name); \ I think another complaint in the PR was that it is unclear what those DOC0/DOC1/DOC strings stand for, if they are keywords on what one writes on the command line or similar (then it should be quoted, %qs or %<%s=%s%>), if it is something different, then maybe it is not the right thing to construct a translatable sentence from that error/warning gmsgid string and one or more words that are inserted somewhere into the sentence. At least for the ARC_OPT the latter seems to be the case, given e.g.: ARC_OPT (FL_LL64, (1ULL << 5), MASK_LL64, "double load/store") ARC_OPT (FL_BS, (1ULL << 6), MASK_BARREL_SHIFTER, "barrel shifter") Is barrel shifter a keyword, or just random words added into the sentence? If the latter, then the translators might want to translate that too, but in that case together with the surroundings too. ARC_OPT (FL_SPFP, (1ULL << 12), MASK_SPFP_COMPACT_SET, "single precission FPX") ARC_OPT (FL_DPFP, (1ULL << 13), MASK_DPFP_COMPACT_SET, "double precission FPX") has spelling errors, s/precission/precision/g > if ((arc_selected_cpu->arch_info->dflags & CODE) \ > && (VAR != DEFAULT_##VAR) \ > && (VAR != VAL)) \ > - warning (0, "Option %s is ignored, the default value %s" \ > - " is considered for %s CPU.", DOC0, DOC1, \ > + warning (0, "option %s is ignored, the default value %s" \ > + " is considered for %s CPU", DOC0, DOC1, \ > arc_selected_cpu->name); \ > } while (0); > #define ARC_OPT(NAME, CODE, MASK, DOC) \ > do { \ > if ((!(arc_selected_cpu->arch_info->flags & CODE)) \ > && (target_flags & MASK)) \ > - error ("Option %s is not available for %s CPU", \ > + error ("option %s is not available for %s CPU", \ > DOC, arc_selected_cpu->name); \ > if ((arc_selected_cpu->arch_info->dflags & CODE) \ > && (target_flags_explicit & MASK) \ > && (!(target_flags & MASK))) \ > - warning (0, "Unset option %s is ignored, it is always" \ > - " enabled for %s CPU.", DOC, \ > + warning (0, "unset option %s is ignored, it is always" \ > + " enabled for %s CPU", DOC, \ > arc_selected_cpu->name); \ > } while (0); > > @@ -7268,7 +7268,8 @@ check_if_valid_regno_const (rtx *operands, int opno) > case CONST_INT : > return true; > default: > - error ("register number must be a compile-time constant. Try giving higher optimization levels"); > + error ("register number must be a compile-time constant. " > + "Try giving higher optimization levels"); Similarly to the above case. Jakub ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] [ARC][COMMITTED] Fix diagnostic messages. 2019-04-17 11:27 ` Jakub Jelinek @ 2019-04-17 19:28 ` Marek Polacek 2019-04-24 10:21 ` [PATCH] [ARC][COMMITTED] Fix typos Claudiu Zissulescu 2019-04-24 9:20 ` [PATCH] [ARC][COMMITTED] Fix diagnostic messages Claudiu Zissulescu 1 sibling, 1 reply; 5+ messages in thread From: Marek Polacek @ 2019-04-17 19:28 UTC (permalink / raw) To: Jakub Jelinek; +Cc: Claudiu Zissulescu, gcc-patches, andrew.burgess, fbedard On Wed, Apr 17, 2019 at 01:25:05PM +0200, Jakub Jelinek wrote: > On Wed, Apr 17, 2019 at 02:09:33PM +0300, Claudiu Zissulescu wrote: > > /* Warn for unimplemented PIC in pre-ARC700 cores, and disable flag_pic. */ > > if (flag_pic && TARGET_ARC600_FAMILY) > > { > > warning (0, > > - "PIC is not supported for %s. Generating non-PIC code only..", > > + "PIC is not supported for %s. Generating non-PIC code only", > > arc_cpu_string); > > I believe this is undesirable too. Either use something like > "PIC is not supported for %s; generating non-PIC code only" > or split that into two messages > if (warning (0, "PIC is not supported for %s", arc_cpu_string)) > inform (input_location, "generating non-PIC code only"); And I suppose we should avoid pleonasm like "PIC code" ;). Marek ^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] [ARC][COMMITTED] Fix typos. 2019-04-17 19:28 ` Marek Polacek @ 2019-04-24 10:21 ` Claudiu Zissulescu 0 siblings, 0 replies; 5+ messages in thread From: Claudiu Zissulescu @ 2019-04-24 10:21 UTC (permalink / raw) To: gcc-patches; +Cc: andrew.burgess, fbedard, jakub From: claziss <claziss@138bc75d-0d04-0410-961f-82ee72b054a4> gcc/ xxxx-xx-xx Claudiu Zissulescu <claziss@synopsys.com> * config/arc/arc-options.def: Fix typos and spelling mistakes. * config/arc/arc.c (arc_init): Cleanup warning message. (arc_override_options): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@270540 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 6 ++++++ gcc/config/arc/arc-options.def | 12 ++++++------ gcc/config/arc/arc.c | 18 ++++++++++-------- 3 files changed, 22 insertions(+), 14 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ba06d65583c..1c70df7ce96 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2019-04-24 Claudiu Zissulescu <claziss@sysnopsys.com> + + * config/arc/arc-options.def: Fix typos and spelling mistakes. + * config/arc/arc.c (arc_init): Cleanup warning message. + (arc_override_options): Likewise. + 2019-04-24 Jakub Jelinek <jakub@redhat.com> PR target/90187 diff --git a/gcc/config/arc/arc-options.def b/gcc/config/arc/arc-options.def index a521b6f9b4e..4b2dcb16e6c 100644 --- a/gcc/config/arc/arc-options.def +++ b/gcc/config/arc/arc-options.def @@ -68,9 +68,9 @@ ARC_OPT (FL_SWAP, (1ULL << 7), MASK_SWAP_SET, "swap") ARC_OPT (FL_MUL64, (1ULL << 8), MASK_MUL64_SET, "mul64") ARC_OPT (FL_MUL32x16, (1ULL << 9), MASK_MULMAC_32BY16_SET, "mul32x16") -ARC_OPT (FL_EA, (1ULL << 11), MASK_EA_SET, "extended arithmetics") -ARC_OPT (FL_SPFP, (1ULL << 12), MASK_SPFP_COMPACT_SET, "single precission FPX") -ARC_OPT (FL_DPFP, (1ULL << 13), MASK_DPFP_COMPACT_SET, "double precission FPX") +ARC_OPT (FL_EA, (1ULL << 11), MASK_EA_SET, "extended arithmetic") +ARC_OPT (FL_SPFP, (1ULL << 12), MASK_SPFP_COMPACT_SET, "single precision FPX") +ARC_OPT (FL_DPFP, (1ULL << 13), MASK_DPFP_COMPACT_SET, "double precision FPX") ARC_OPT (FL_ARGONAUT, (1ULL << 14), MASK_ARGONAUT_SET, "argonaut") ARC_OPT (FL_SIMD, (1ULL << 15), MASK_SIMD_SET, "simd") @@ -101,9 +101,9 @@ ARC_OPTX (FL_FPU_FPUD_FMA, (1ULL << 36), arc_fpu_build, FPU_FPUD_FMA, "mfpu", " ARC_OPTX (FL_FPU_FPUD_ALL, (1ULL << 37), arc_fpu_build, FPU_FPUD_ALL, "mfpu", "fpud_all") ARC_OPTX (FL_FPX_QUARK, (1ULL << 38), arc_fpu_build, FPX_QK, "quarkse fp", "N.A.") -ARC_OPT (FL_FPUS, (0xFULL << 26), 0, "single precission floating point") -ARC_OPT (FL_FPUDA, (0xFFULL << 26), 0, "double precission fp assist") -ARC_OPT (FL_FPUD, (0xF0FULL << 26), 0, "double precission floating point") +ARC_OPT (FL_FPUS, (0xFULL << 26), 0, "single precision floating point") +ARC_OPT (FL_FPUDA, (0xFFULL << 26), 0, "double precision fp assist") +ARC_OPT (FL_FPUD, (0xF0FULL << 26), 0, "double precision floating point") ARC_OPT (FL_QUARK, (1ULL << 38), 0, "Quark SE fp extension") /* Local Variables: */ diff --git a/gcc/config/arc/arc.c b/gcc/config/arc/arc.c index 1a04f9ef793..2f5753b02fa 100644 --- a/gcc/config/arc/arc.c +++ b/gcc/config/arc/arc.c @@ -955,8 +955,7 @@ arc_init (void) /* Warn for unimplemented PIC in pre-ARC700 cores, and disable flag_pic. */ if (flag_pic && TARGET_ARC600_FAMILY) { - warning (0, - "PIC is not supported for %s. Generating non-PIC code only", + warning (0, "PIC is not supported for %qs", arc_cpu_string); flag_pic = 0; } @@ -1218,30 +1217,33 @@ arc_override_options (void) option is not allowed. Extra, check options against default architecture/cpu flags and throw an warning if we find a mismatch. */ + /* TRANSLATORS: the DOC/DOC0/DOC1 are strings which shouldn't be + translated. They are like keywords which one can relate with the + architectural choices taken for an ARC CPU implementation. */ #define ARC_OPTX(NAME, CODE, VAR, VAL, DOC0, DOC1) \ do { \ if ((!(arc_selected_cpu->arch_info->flags & CODE)) \ && (VAR == VAL)) \ - error ("option %s=%s is not available for %s CPU", \ + error ("option %<%s=%s%> is not available for %qs CPU", \ DOC0, DOC1, arc_selected_cpu->name); \ if ((arc_selected_cpu->arch_info->dflags & CODE) \ && (VAR != DEFAULT_##VAR) \ && (VAR != VAL)) \ - warning (0, "option %s is ignored, the default value %s" \ - " is considered for %s CPU", DOC0, DOC1, \ + warning (0, "option %qs is ignored, the default value %qs" \ + " is considered for %qs CPU", DOC0, DOC1, \ arc_selected_cpu->name); \ } while (0); #define ARC_OPT(NAME, CODE, MASK, DOC) \ do { \ if ((!(arc_selected_cpu->arch_info->flags & CODE)) \ && (target_flags & MASK)) \ - error ("option %s is not available for %s CPU", \ + error ("option %qs is not available for %qs CPU", \ DOC, arc_selected_cpu->name); \ if ((arc_selected_cpu->arch_info->dflags & CODE) \ && (target_flags_explicit & MASK) \ && (!(target_flags & MASK))) \ - warning (0, "unset option %s is ignored, it is always" \ - " enabled for %s CPU", DOC, \ + warning (0, "unset option %qs is ignored, it is always" \ + " enabled for %qs CPU", DOC, \ arc_selected_cpu->name); \ } while (0); -- 2.20.1 ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] [ARC][COMMITTED] Fix diagnostic messages. 2019-04-17 11:27 ` Jakub Jelinek 2019-04-17 19:28 ` Marek Polacek @ 2019-04-24 9:20 ` Claudiu Zissulescu 1 sibling, 0 replies; 5+ messages in thread From: Claudiu Zissulescu @ 2019-04-24 9:20 UTC (permalink / raw) To: Jakub Jelinek; +Cc: gcc-patches, Andrew Burgess, Francois Bedard The DOC/DOC0/DOC1 are like keywords to be placed into the warning message. They shouldn't be translated as they can referenced directly in the specific processor architectural options. So, I will use %qs for them, and fix the other signalized problems. Thank you On Wed, Apr 17, 2019 at 2:25 PM Jakub Jelinek <jakub@redhat.com> wrote: > > On Wed, Apr 17, 2019 at 02:09:33PM +0300, Claudiu Zissulescu wrote: > > /* Warn for unimplemented PIC in pre-ARC700 cores, and disable flag_pic. */ > > if (flag_pic && TARGET_ARC600_FAMILY) > > { > > warning (0, > > - "PIC is not supported for %s. Generating non-PIC code only..", > > + "PIC is not supported for %s. Generating non-PIC code only", > > arc_cpu_string); > > I believe this is undesirable too. Either use something like > "PIC is not supported for %s; generating non-PIC code only" > or split that into two messages > if (warning (0, "PIC is not supported for %s", arc_cpu_string)) > inform (input_location, "generating non-PIC code only"); > > > @@ -1222,26 +1222,26 @@ arc_override_options (void) > > do { \ > > if ((!(arc_selected_cpu->arch_info->flags & CODE)) \ > > && (VAR == VAL)) \ > > - error ("Option %s=%s is not available for %s CPU.", \ > > + error ("option %s=%s is not available for %s CPU", \ > > DOC0, DOC1, arc_selected_cpu->name); \ > > I think another complaint in the PR was that it is unclear what > those DOC0/DOC1/DOC strings stand for, if they are keywords on what > one writes on the command line or similar (then it should be quoted, > %qs or %<%s=%s%>), if it is something different, then maybe it is > not the right thing to construct a translatable sentence from that > error/warning gmsgid string and one or more words that are inserted > somewhere into the sentence. At least for the ARC_OPT the latter seems to > be the case, given e.g.: > ARC_OPT (FL_LL64, (1ULL << 5), MASK_LL64, "double load/store") > ARC_OPT (FL_BS, (1ULL << 6), MASK_BARREL_SHIFTER, "barrel shifter") > Is barrel shifter a keyword, or just random words added into the sentence? > If the latter, then the translators might want to translate that too, but in > that case together with the surroundings too. > ARC_OPT (FL_SPFP, (1ULL << 12), MASK_SPFP_COMPACT_SET, "single precission FPX") > ARC_OPT (FL_DPFP, (1ULL << 13), MASK_DPFP_COMPACT_SET, "double precission FPX") > has spelling errors, > s/precission/precision/g > > > if ((arc_selected_cpu->arch_info->dflags & CODE) \ > > && (VAR != DEFAULT_##VAR) \ > > && (VAR != VAL)) \ > > - warning (0, "Option %s is ignored, the default value %s" \ > > - " is considered for %s CPU.", DOC0, DOC1, \ > > + warning (0, "option %s is ignored, the default value %s" \ > > + " is considered for %s CPU", DOC0, DOC1, \ > > arc_selected_cpu->name); \ > > } while (0); > > #define ARC_OPT(NAME, CODE, MASK, DOC) \ > > do { \ > > if ((!(arc_selected_cpu->arch_info->flags & CODE)) \ > > && (target_flags & MASK)) \ > > - error ("Option %s is not available for %s CPU", \ > > + error ("option %s is not available for %s CPU", \ > > DOC, arc_selected_cpu->name); \ > > if ((arc_selected_cpu->arch_info->dflags & CODE) \ > > && (target_flags_explicit & MASK) \ > > && (!(target_flags & MASK))) \ > > - warning (0, "Unset option %s is ignored, it is always" \ > > - " enabled for %s CPU.", DOC, \ > > + warning (0, "unset option %s is ignored, it is always" \ > > + " enabled for %s CPU", DOC, \ > > arc_selected_cpu->name); \ > > } while (0); > > > > @@ -7268,7 +7268,8 @@ check_if_valid_regno_const (rtx *operands, int opno) > > case CONST_INT : > > return true; > > default: > > - error ("register number must be a compile-time constant. Try giving higher optimization levels"); > > + error ("register number must be a compile-time constant. " > > + "Try giving higher optimization levels"); > > Similarly to the above case. > > Jakub ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2019-04-24 10:20 UTC | newest] Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2019-04-17 11:14 [PATCH] [ARC][COMMITTED] Fix diagnostic messages Claudiu Zissulescu 2019-04-17 11:27 ` Jakub Jelinek 2019-04-17 19:28 ` Marek Polacek 2019-04-24 10:21 ` [PATCH] [ARC][COMMITTED] Fix typos Claudiu Zissulescu 2019-04-24 9:20 ` [PATCH] [ARC][COMMITTED] Fix diagnostic messages Claudiu Zissulescu
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).