* [PATCH] Remove Pascal language in source code.
@ 2017-07-11 14:30 Martin Liška
2017-07-11 14:42 ` [RFC] Remaining references of Pascal Martin Liška
2017-07-13 14:59 ` [PATCH] Remove Pascal language in source code Jeff Law
0 siblings, 2 replies; 8+ messages in thread
From: Martin Liška @ 2017-07-11 14:30 UTC (permalink / raw)
To: gcc-patches
[-- Attachment #1: Type: text/plain, Size: 796 bytes --]
Hi.
Similar for GNU Pascal language.
Patch can bootstrap on ppc64le-redhat-linux and survives regression tests.
Ready to be installed?
Martin
gcc/ChangeLog:
2017-07-11 Martin Liska <mliska@suse.cz>
* dbxout.c (get_lang_number): Do not handle GNU Pascal.
* dbxout.h (extern void dbxout_stab_value_internal_label_diff):
Remove N_SO_PASCAL.
* dwarf2out.c (lower_bound_default): Do not handle
DW_LANG_Pascal83.
(gen_compile_unit_die): Likewise.
* gcc.c: Remove default extension binding for GNU Pascal.
* stmt.c: Remove Pascal language from a comment.
* xcoffout.c: Likewise.
---
gcc/dbxout.c | 2 --
gcc/dbxout.h | 1 -
gcc/dwarf2out.c | 3 ---
gcc/gcc.c | 1 -
gcc/stmt.c | 2 +-
gcc/xcoffout.c | 2 +-
6 files changed, 2 insertions(+), 9 deletions(-)
[-- Attachment #2: 0001-Remove-Pascal-language-in-source-code.patch --]
[-- Type: text/x-patch, Size: 3114 bytes --]
diff --git a/gcc/dbxout.c b/gcc/dbxout.c
index bb8ca3254c0..783a70bec4f 100644
--- a/gcc/dbxout.c
+++ b/gcc/dbxout.c
@@ -952,8 +952,6 @@ get_lang_number (void)
return N_SO_FORTRAN;
else if (lang_GNU_Fortran ())
return N_SO_FORTRAN90; /* CHECKME */
- else if (strcmp (language_string, "GNU Pascal") == 0)
- return N_SO_PASCAL;
else if (strcmp (language_string, "GNU Objective-C") == 0)
return N_SO_OBJC;
else if (strcmp (language_string, "GNU Objective-C++") == 0)
diff --git a/gcc/dbxout.h b/gcc/dbxout.h
index ee6a08d2deb..c3582603253 100644
--- a/gcc/dbxout.h
+++ b/gcc/dbxout.h
@@ -53,7 +53,6 @@ extern void dbxout_stab_value_internal_label_diff (const char *, int *,
#define N_SO_ANSI_C 3
#define N_SO_CC 4 /* c++*/
#define N_SO_FORTRAN 5
-#define N_SO_PASCAL 6
#define N_SO_FORTRAN90 7
#define N_SO_OBJC 50
#define N_SO_OBJCPLUS 51
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 491c778d58a..9357a100f6a 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -19835,7 +19835,6 @@ lower_bound_default (void)
case DW_LANG_Ada83:
case DW_LANG_Cobol74:
case DW_LANG_Cobol85:
- case DW_LANG_Pascal83:
case DW_LANG_Modula2:
case DW_LANG_PLI:
return dwarf_version >= 4 ? 1 : -1;
@@ -23565,8 +23564,6 @@ gen_compile_unit_die (const char *filename)
}
else if (strcmp (language_string, "GNU F77") == 0)
language = DW_LANG_Fortran77;
- else if (strcmp (language_string, "GNU Pascal") == 0)
- language = DW_LANG_Pascal83;
else if (dwarf_version >= 3 || !dwarf_strict)
{
if (strcmp (language_string, "GNU Ada") == 0)
diff --git a/gcc/gcc.c b/gcc/gcc.c
index ea8858da5d1..d8c5260e36b 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -1305,7 +1305,6 @@ static const struct compiler default_compilers[] =
{".f03", "#Fortran", 0, 0, 0}, {".F03", "#Fortran", 0, 0, 0},
{".f08", "#Fortran", 0, 0, 0}, {".F08", "#Fortran", 0, 0, 0},
{".r", "#Ratfor", 0, 0, 0},
- {".p", "#Pascal", 0, 0, 0}, {".pas", "#Pascal", 0, 0, 0},
{".go", "#Go", 0, 1, 0},
/* Next come the entries for C. */
{".c", "@c", 0, 0, 1},
diff --git a/gcc/stmt.c b/gcc/stmt.c
index 10d394eee69..05e24f00707 100644
--- a/gcc/stmt.c
+++ b/gcc/stmt.c
@@ -1105,7 +1105,7 @@ compute_cases_per_edge (gswitch *stmt)
}
}
-/* Terminate a case (Pascal/Ada) or switch (C) statement
+/* Terminate a case Ada or switch (C) statement
in which ORIG_INDEX is the expression to be tested.
If ORIG_TYPE is not NULL, it is the original ORIG_INDEX
type as given in the source before any compiler conversions.
diff --git a/gcc/xcoffout.c b/gcc/xcoffout.c
index c6eab21a55d..17b201aced6 100644
--- a/gcc/xcoffout.c
+++ b/gcc/xcoffout.c
@@ -143,7 +143,7 @@ static const struct xcoff_type_number xcoff_type_numbers[] = {
{ "float", -12 },
{ "double", -13 },
{ "long double", -14 },
- /* Pascal and Fortran types run from -15 to -29. */
+ /* Fortran types run from -15 to -29. */
{ "wchar", -30 }, /* XXX Should be "wchar_t" ? */
{ "long long int", -31 },
{ "long long unsigned int", -32 },
^ permalink raw reply [flat|nested] 8+ messages in thread
* [RFC] Remaining references of Pascal
2017-07-11 14:30 [PATCH] Remove Pascal language in source code Martin Liška
@ 2017-07-11 14:42 ` Martin Liška
2017-07-11 15:57 ` Jason Merrill
2017-07-13 14:59 ` [PATCH] Remove Pascal language in source code Jeff Law
1 sibling, 1 reply; 8+ messages in thread
From: Martin Liška @ 2017-07-11 14:42 UTC (permalink / raw)
To: gcc-patches; +Cc: Jason Merrill, Jakub Jelinek
And there are remaining references of Pascal:
1) dbxout.c:
1661 {
1662 stabstr_C ('r');
1663 if (TREE_TYPE (type))
1664 dbxout_type (TREE_TYPE (type), 0);
1665 else if (TREE_CODE (type) != INTEGER_TYPE)
1666 dbxout_type (type, 0); /* E.g. Pascal's ARRAY [BOOLEAN] of INTEGER */
1667 else
1668 {
Can we remove that Jason? It's dead according to LCOV output.
2) dwarf2out.c:
23295
23296 #if 0
23297 /* Don't generate either pointer_type DIEs or reference_type DIEs here.
23298 Use modified_type_die instead.
23299 We keep this code here just in case these types of DIEs may be needed to
23300 represent certain things in other languages (e.g. Pascal) someday. */
23301
23302 static void
23303 gen_pointer_type_die (tree type, dw_die_ref context_die)
23304 {
23305 dw_die_ref ptr_die
--
23312 }
23313
23314 /* Don't generate either pointer_type DIEs or reference_type DIEs here.
23315 Use modified_type_die instead.
23316 We keep this code here just in case these types of DIEs may be needed to
23317 represent certain things in other languages (e.g. Pascal) someday. */
23318
23319 static void
23320 gen_reference_type_die (tree type, dw_die_ref context_die)
23321 {
23322 dw_die_ref ref_die, scope_die = scope_die_for (type, context_die);
The piece of code is guarded in #if 0, is it candidate for removal?
3) stor-layout.c:
2648 /* Set the extreme values of TYPE based on its precision in bits,
2649 then lay it out. Used when make_signed_type won't do
2650 because the tree code is not INTEGER_TYPE.
2651 E.g. for Pascal, when the -fsigned-char option is given. */
2652
2653 void
2654 fixup_signed_type (tree type)
2655 {
2656 int precision = TYPE_PRECISION (type);
2657
2658 set_min_and_max_values_for_integral_type (type, precision, SIGNED);
2659
2660 /* Lay out the type: set its alignment, size, etc. */
2661 layout_type (type);
This is probably useful not just for Pascal?
Thanks,
Martin
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [RFC] Remaining references of Pascal
2017-07-11 14:42 ` [RFC] Remaining references of Pascal Martin Liška
@ 2017-07-11 15:57 ` Jason Merrill
2017-07-13 8:10 ` [PATCH] Cleanup #2 of Pascal references Martin Liška
0 siblings, 1 reply; 8+ messages in thread
From: Jason Merrill @ 2017-07-11 15:57 UTC (permalink / raw)
To: Martin Liška; +Cc: gcc-patches List, Jakub Jelinek
On Tue, Jul 11, 2017 at 10:42 AM, Martin Liška <mliska@suse.cz> wrote:
> And there are remaining references of Pascal:
>
> 1) dbxout.c:
>
> 1661 {
> 1662 stabstr_C ('r');
> 1663 if (TREE_TYPE (type))
> 1664 dbxout_type (TREE_TYPE (type), 0);
> 1665 else if (TREE_CODE (type) != INTEGER_TYPE)
> 1666 dbxout_type (type, 0); /* E.g. Pascal's ARRAY [BOOLEAN] of
> INTEGER */
> 1667 else
> 1668 {
>
> Can we remove that Jason? It's dead according to LCOV output.
I don't know dbxout, but it seems pretty harmless; I'd be inclined to
keep it even if no current front ends use it.
> 2) dwarf2out.c:
>
> 23295
> 23296 #if 0
> 23297 /* Don't generate either pointer_type DIEs or reference_type DIEs
> here.
> 23298 Use modified_type_die instead.
> 23299 We keep this code here just in case these types of DIEs may be
> needed to
> 23300 represent certain things in other languages (e.g. Pascal)
> someday. */
> 23301
> 23302 static void
> 23303 gen_pointer_type_die (tree type, dw_die_ref context_die)
> 23304 {
> 23305 dw_die_ref ptr_die
> --
> 23312 }
> 23313
> 23314 /* Don't generate either pointer_type DIEs or reference_type DIEs
> here.
> 23315 Use modified_type_die instead.
> 23316 We keep this code here just in case these types of DIEs may be
> needed to
> 23317 represent certain things in other languages (e.g. Pascal)
> someday. */
> 23318
> 23319 static void
> 23320 gen_reference_type_die (tree type, dw_die_ref context_die)
> 23321 {
> 23322 dw_die_ref ref_die, scope_die = scope_die_for (type, context_die);
>
> The piece of code is guarded in #if 0, is it candidate for removal?
Yes, go ahead.
> 3) stor-layout.c:
>
> 2648 /* Set the extreme values of TYPE based on its precision in bits,
> 2649 then lay it out. Used when make_signed_type won't do
> 2650 because the tree code is not INTEGER_TYPE.
> 2651 E.g. for Pascal, when the -fsigned-char option is given. */
> 2652
> 2653 void
> 2654 fixup_signed_type (tree type)
> 2655 {
> 2656 int precision = TYPE_PRECISION (type);
> 2657
> 2658 set_min_and_max_values_for_integral_type (type, precision,
> SIGNED);
> 2659
> 2660 /* Lay out the type: set its alignment, size, etc. */
> 2661 layout_type (type);
>
> This is probably useful not just for Pascal?
Agreed.
Jason
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH] Cleanup #2 of Pascal references.
2017-07-11 15:57 ` Jason Merrill
@ 2017-07-13 8:10 ` Martin Liška
2017-07-13 13:37 ` Jason Merrill
0 siblings, 1 reply; 8+ messages in thread
From: Martin Liška @ 2017-07-13 8:10 UTC (permalink / raw)
To: Jason Merrill; +Cc: gcc-patches List, Jakub Jelinek
[-- Attachment #1: Type: text/plain, Size: 61 bytes --]
Thanks Jason, I'm sending patch #2.
Ready for trunk?
Martin
[-- Attachment #2: 0001-Cleanup-2-of-Pascal-references.patch --]
[-- Type: text/x-patch, Size: 3038 bytes --]
From 2fa6d00cc6686e8bf081d736de44c22ecf61a795 Mon Sep 17 00:00:00 2001
From: marxin <mliska@suse.cz>
Date: Thu, 13 Jul 2017 10:08:14 +0200
Subject: [PATCH] Cleanup #2 of Pascal references.
gcc/ChangeLog:
2017-07-13 Martin Liska <mliska@suse.cz>
* dwarf2out.c (gen_pointer_type_die): Remove dead code.
(gen_reference_type_die): Likewise.
* stor-layout.c: Remove Pascal-related comment.
---
gcc/dwarf2out.c | 40 ----------------------------------------
gcc/stor-layout.c | 3 +--
2 files changed, 1 insertion(+), 42 deletions(-)
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 9357a100f6a..e50428e4e31 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -23293,46 +23293,6 @@ gen_field_die (tree decl, struct vlr_context *ctx, dw_die_ref context_die)
equate_decl_number_to_die (decl, decl_die);
}
-#if 0
-/* Don't generate either pointer_type DIEs or reference_type DIEs here.
- Use modified_type_die instead.
- We keep this code here just in case these types of DIEs may be needed to
- represent certain things in other languages (e.g. Pascal) someday. */
-
-static void
-gen_pointer_type_die (tree type, dw_die_ref context_die)
-{
- dw_die_ref ptr_die
- = new_die (DW_TAG_pointer_type, scope_die_for (type, context_die), type);
-
- equate_type_number_to_die (type, ptr_die);
- add_type_attribute (ptr_die, TREE_TYPE (type), TYPE_UNQUALIFIED, false,
- context_die);
- add_AT_unsigned (mod_type_die, DW_AT_byte_size, PTR_SIZE);
-}
-
-/* Don't generate either pointer_type DIEs or reference_type DIEs here.
- Use modified_type_die instead.
- We keep this code here just in case these types of DIEs may be needed to
- represent certain things in other languages (e.g. Pascal) someday. */
-
-static void
-gen_reference_type_die (tree type, dw_die_ref context_die)
-{
- dw_die_ref ref_die, scope_die = scope_die_for (type, context_die);
-
- if (TYPE_REF_IS_RVALUE (type) && dwarf_version >= 4)
- ref_die = new_die (DW_TAG_rvalue_reference_type, scope_die, type);
- else
- ref_die = new_die (DW_TAG_reference_type, scope_die, type);
-
- equate_type_number_to_die (type, ref_die);
- add_type_attribute (ref_die, TREE_TYPE (type), TYPE_UNQUALIFIED, false,
- context_die);
- add_AT_unsigned (mod_type_die, DW_AT_byte_size, PTR_SIZE);
-}
-#endif
-
/* Generate a DIE for a pointer to a member type. TYPE can be an
OFFSET_TYPE, for a pointer to data member, or a RECORD_TYPE, for a
pointer to member function. */
diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c
index 1574e4383e8..f733b1e4609 100644
--- a/gcc/stor-layout.c
+++ b/gcc/stor-layout.c
@@ -2647,8 +2647,7 @@ set_min_and_max_values_for_integral_type (tree type,
/* Set the extreme values of TYPE based on its precision in bits,
then lay it out. Used when make_signed_type won't do
- because the tree code is not INTEGER_TYPE.
- E.g. for Pascal, when the -fsigned-char option is given. */
+ because the tree code is not INTEGER_TYPE. */
void
fixup_signed_type (tree type)
--
2.13.2
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] Cleanup #2 of Pascal references.
2017-07-13 8:10 ` [PATCH] Cleanup #2 of Pascal references Martin Liška
@ 2017-07-13 13:37 ` Jason Merrill
0 siblings, 0 replies; 8+ messages in thread
From: Jason Merrill @ 2017-07-13 13:37 UTC (permalink / raw)
To: Martin Liška; +Cc: gcc-patches List, Jakub Jelinek
OK.
On Thu, Jul 13, 2017 at 4:10 AM, Martin Liška <mliska@suse.cz> wrote:
> Thanks Jason, I'm sending patch #2.
>
> Ready for trunk?
> Martin
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] Remove Pascal language in source code.
2017-07-11 14:30 [PATCH] Remove Pascal language in source code Martin Liška
2017-07-11 14:42 ` [RFC] Remaining references of Pascal Martin Liška
@ 2017-07-13 14:59 ` Jeff Law
2017-07-13 16:07 ` Pedro Alves
1 sibling, 1 reply; 8+ messages in thread
From: Jeff Law @ 2017-07-13 14:59 UTC (permalink / raw)
To: Martin Liška, gcc-patches
On 07/11/2017 08:30 AM, Martin Liška wrote:
> Hi.
>
> Similar for GNU Pascal language.
>
> Patch can bootstrap on ppc64le-redhat-linux and survives regression tests.
>
> Ready to be installed?
>
> Martin
>
> gcc/ChangeLog:
>
> 2017-07-11 Martin Liska <mliska@suse.cz>
>
> * dbxout.c (get_lang_number): Do not handle GNU Pascal.
> * dbxout.h (extern void dbxout_stab_value_internal_label_diff):
> Remove N_SO_PASCAL.
> * dwarf2out.c (lower_bound_default): Do not handle
> DW_LANG_Pascal83.
> (gen_compile_unit_die): Likewise.
> * gcc.c: Remove default extension binding for GNU Pascal.
> * stmt.c: Remove Pascal language from a comment.
> * xcoffout.c: Likewise.
The only concern I'd have here is the bits in dbxout.[ch] might
effectively be the best documentation of the dbxout format that exists.
Thus, dropping something like N_SO_PASCAL loses that historical
documentation.
Even with that caveat, I think this should go into the trunk. In the
unlikely event we really need that historical record, we have svn/git.
jeff
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] Remove Pascal language in source code.
2017-07-13 14:59 ` [PATCH] Remove Pascal language in source code Jeff Law
@ 2017-07-13 16:07 ` Pedro Alves
2017-07-14 7:05 ` Martin Liška
0 siblings, 1 reply; 8+ messages in thread
From: Pedro Alves @ 2017-07-13 16:07 UTC (permalink / raw)
To: Jeff Law, Martin Liška, gcc-patches
On 07/13/2017 03:59 PM, Jeff Law wrote:
> The only concern I'd have here is the bits in dbxout.[ch] might
> effectively be the best documentation of the dbxout format that exists.
> Thus, dropping something like N_SO_PASCAL loses that historical
> documentation.
FYI, there's a texinfo document in the GDB repo describing the
stabs format, and it documents N_SO_PASCAL:
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=blob;f=gdb/doc/stabs.texinfo;h=a7ea808a41b290b7dfc4f44801a540a834ee04db;hb=HEAD#l440
A pre-generated html version is live here:
https://www.sourceware.org/gdb/onlinedocs/stabs.html
https://www.sourceware.org/gdb/onlinedocs/stabs.html#Source-Files
Thanks,
Pedro Alves
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] Remove Pascal language in source code.
2017-07-13 16:07 ` Pedro Alves
@ 2017-07-14 7:05 ` Martin Liška
0 siblings, 0 replies; 8+ messages in thread
From: Martin Liška @ 2017-07-14 7:05 UTC (permalink / raw)
To: Pedro Alves, Jeff Law, gcc-patches
On 07/13/2017 06:06 PM, Pedro Alves wrote:
> On 07/13/2017 03:59 PM, Jeff Law wrote:
>
>> The only concern I'd have here is the bits in dbxout.[ch] might
>> effectively be the best documentation of the dbxout format that exists.
>> Thus, dropping something like N_SO_PASCAL loses that historical
>> documentation.
>
> FYI, there's a texinfo document in the GDB repo describing the
> stabs format, and it documents N_SO_PASCAL:
>
> https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=blob;f=gdb/doc/stabs.texinfo;h=a7ea808a41b290b7dfc4f44801a540a834ee04db;hb=HEAD#l440
>
> A pre-generated html version is live here:
>
> https://www.sourceware.org/gdb/onlinedocs/stabs.html
> https://www.sourceware.org/gdb/onlinedocs/stabs.html#Source-Files
>
> Thanks,
> Pedro Alves
>
Thank you both. After what was said, I installed the patch as r250197.
Martin
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2017-07-14 7:05 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-11 14:30 [PATCH] Remove Pascal language in source code Martin Liška
2017-07-11 14:42 ` [RFC] Remaining references of Pascal Martin Liška
2017-07-11 15:57 ` Jason Merrill
2017-07-13 8:10 ` [PATCH] Cleanup #2 of Pascal references Martin Liška
2017-07-13 13:37 ` Jason Merrill
2017-07-13 14:59 ` [PATCH] Remove Pascal language in source code Jeff Law
2017-07-13 16:07 ` Pedro Alves
2017-07-14 7:05 ` Martin Liška
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).