* [patch] Fix PR41764 @ 2009-10-21 18:09 Rafael Espindola 2009-10-21 22:46 ` Rafael Espindola 0 siblings, 1 reply; 9+ messages in thread From: Rafael Espindola @ 2009-10-21 18:09 UTC (permalink / raw) To: GCC Patches; +Cc: Richard Guenther, Diego Novillo, Paul Brook [-- Attachment #1: Type: text/plain, Size: 491 bytes --] The attached patch fixes PR 41764. The problem was that the fortran FE was creating fake variables and marking them public. They were not written to the final assembly becouse the FE sets TREE_ASM_WRITTEN, but they were in the IL symbol table. OK if bootstraps and tests are OK? 2009-10-21 Rafael Avila de Espindola <espindola@google.com> PR 41764 * trans-common.c (create_common): Set TREE_PUBLIC to false on fake variables. Cheers, -- Rafael Ávila de Espíndola [-- Attachment #2: fake.patch --] [-- Type: text/x-diff, Size: 1084 bytes --] diff --git a/gcc/fortran/trans-common.c b/gcc/fortran/trans-common.c index 5b1952a..1fb3c40 100644 --- a/gcc/fortran/trans-common.c +++ b/gcc/fortran/trans-common.c @@ -680,7 +680,6 @@ create_common (gfc_common_head *com, segment_info *head, bool saw_equiv) var_decl = build_decl (s->sym->declared_at.lb->location, VAR_DECL, DECL_NAME (s->field), TREE_TYPE (s->field)); - TREE_PUBLIC (var_decl) = TREE_PUBLIC (decl); TREE_STATIC (var_decl) = TREE_STATIC (decl); TREE_USED (var_decl) = TREE_USED (decl); if (s->sym->attr.use_assoc) @@ -689,7 +688,9 @@ create_common (gfc_common_head *com, segment_info *head, bool saw_equiv) TREE_ADDRESSABLE (var_decl) = 1; /* This is a fake variable just for debugging purposes. */ TREE_ASM_WRITTEN (var_decl) = 1; - + /* Fake variables are not visible from other translation units. */ + TREE_PUBLIC (var_decl) = 0; + /* To preserve identifier names in COMMON, chain to procedure scope unless at top level in a module definition. */ if (com ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [patch] Fix PR41764 2009-10-21 18:09 [patch] Fix PR41764 Rafael Espindola @ 2009-10-21 22:46 ` Rafael Espindola 2009-10-26 18:53 ` Rafael Espindola 0 siblings, 1 reply; 9+ messages in thread From: Rafael Espindola @ 2009-10-21 22:46 UTC (permalink / raw) To: GCC Patches; +Cc: Richard Guenther, Diego Novillo, Paul Brook > OK if bootstraps and tests are OK? Looks like this breaks debug generation for fortran: gfortran.dg/debug/pr35154-dwarf2.f scan-assembler (DW_AT_name: "__BLNK__"|"__BLNK__[^\n]*"[^\n]*DW_AT_name) gfortran.dg/debug/pr35154-dwarf2.f scan-assembler (DW_AT_name: "__BLNK__"|"__BLNK__[^\n]*"[^\n]*DW_AT_name) gfortran.dg/debug/pr35154-dwarf2.f scan-assembler (DW_AT_name: "label"|"label[^\n]*"[^\n]*DW_AT_name) gfortran.dg/debug/pr35154-dwarf2.f scan-assembler (DW_AT_name: "label"|"label[^\n]*"[^\n]*DW_AT_name) gfortran.dg/debug/pr35154-dwarf2.f scan-assembler DIE[^\n]*DW_TAG_common_block gfortran.dg/debug/pr35154-dwarf2.f scan-assembler DIE[^\n]*DW_TAG_common_block gfortran.dg/debug/pr35154-dwarf2.f scan-assembler DIE[^\n]*DW_TAG_common_block gfortran.dg/debug/pr35154-dwarf2.f scan-assembler DIE[^\n]*DW_TAG_common_block gfortran.dg/debug/pr35154-stabs.f scan-assembler .stabs.*"__BLNK__",226 gfortran.dg/debug/pr35154-stabs.f scan-assembler .stabs.*"__BLNK__",228 gfortran.dg/debug/pr35154-stabs.f scan-assembler .stabs.*"label_",226 gfortran.dg/debug/pr35154-stabs.f scan-assembler .stabs.*"label_",228 gfortran.dg/debug/pr37738.f scan-assembler-times DIE[^\n]*DW_TAG_common_block 3 gfortran.dg/debug/pr37738.f scan-assembler-times DIE[^\n]*DW_TAG_common_block 3 Will try to debug, but could really use some help from someone that knows fortran (and gfortran). Cheers, -- Rafael Ávila de Espíndola ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [patch] Fix PR41764 2009-10-21 22:46 ` Rafael Espindola @ 2009-10-26 18:53 ` Rafael Espindola 2009-10-28 4:24 ` Rafael Espindola 0 siblings, 1 reply; 9+ messages in thread From: Rafael Espindola @ 2009-10-26 18:53 UTC (permalink / raw) To: GCC Patches; +Cc: Richard Guenther, Diego Novillo, Paul Brook [-- Attachment #1: Type: text/plain, Size: 454 bytes --] > Looks like this breaks debug generation for fortran: The attached patch reduces the problems to: gfortran.dg/debug/pr35154-stabs.f scan-assembler .stabs.*"__BLNK__",226 gfortran.dg/debug/pr35154-stabs.f scan-assembler .stabs.*"__BLNK__",228 gfortran.dg/debug/pr35154-stabs.f scan-assembler .stabs.*"label_",226 gfortran.dg/debug/pr35154-stabs.f scan-assembler .stabs.*"label_",228 Debugging... Cheers, -- Rafael Ávila de Espíndola [-- Attachment #2: fake.patch --] [-- Type: text/x-diff, Size: 1823 bytes --] diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index ba59251..cb3d790 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -15606,12 +15606,11 @@ fortran_common (tree decl, HOST_WIDE_INT *value) tree offset; int volatilep = 0, unsignedp = 0; - /* If the decl isn't a VAR_DECL, or if it isn't public or static, or if + /* If the decl isn't a VAR_DECL, or if it isn't static, or if it does not have a value (the offset into the common area), or if it is thread local (as opposed to global) then it isn't common, and shouldn't be handled as such. */ if (TREE_CODE (decl) != VAR_DECL - || !TREE_PUBLIC (decl) || !TREE_STATIC (decl) || !DECL_HAS_VALUE_EXPR_P (decl) || !is_fortran ()) diff --git a/gcc/fortran/trans-common.c b/gcc/fortran/trans-common.c index 5b1952a..1fb3c40 100644 --- a/gcc/fortran/trans-common.c +++ b/gcc/fortran/trans-common.c @@ -680,7 +680,6 @@ create_common (gfc_common_head *com, segment_info *head, bool saw_equiv) var_decl = build_decl (s->sym->declared_at.lb->location, VAR_DECL, DECL_NAME (s->field), TREE_TYPE (s->field)); - TREE_PUBLIC (var_decl) = TREE_PUBLIC (decl); TREE_STATIC (var_decl) = TREE_STATIC (decl); TREE_USED (var_decl) = TREE_USED (decl); if (s->sym->attr.use_assoc) @@ -689,7 +688,9 @@ create_common (gfc_common_head *com, segment_info *head, bool saw_equiv) TREE_ADDRESSABLE (var_decl) = 1; /* This is a fake variable just for debugging purposes. */ TREE_ASM_WRITTEN (var_decl) = 1; - + /* Fake variables are not visible from other translation units. */ + TREE_PUBLIC (var_decl) = 0; + /* To preserve identifier names in COMMON, chain to procedure scope unless at top level in a module definition. */ if (com ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [patch] Fix PR41764 2009-10-26 18:53 ` Rafael Espindola @ 2009-10-28 4:24 ` Rafael Espindola 2009-10-28 14:27 ` Rafael Espindola 2009-10-28 14:34 ` Ian Lance Taylor 0 siblings, 2 replies; 9+ messages in thread From: Rafael Espindola @ 2009-10-28 4:24 UTC (permalink / raw) To: GCC Patches; +Cc: Richard Guenther, Diego Novillo, Paul Brook [-- Attachment #1: Type: text/plain, Size: 542 bytes --] > Debugging... The joys of duplicated code... The attached patch fixes the PR, bootstraps and passes the regression tests. Is it OK? gcc/ 2009-10-27 Rafael Avila de Espindola <espindola@google.com> * dbxout.c (dbxout_common_check): Accept non public trees. * dwarf2out.c (fortran_common): Accept non public trees. gcc/fortran/ 2009-10-27 Rafael Avila de Espindola <espindola@google.com> * trans-common.c (create_common): Set TREE_PUBLIC to false on fake variables. Cheers, -- Rafael Ávila de Espíndola [-- Attachment #2: fake.patch --] [-- Type: text/x-diff, Size: 2706 bytes --] diff --git a/gcc/dbxout.c b/gcc/dbxout.c index b5688d9..0bf5e3c 100644 --- a/gcc/dbxout.c +++ b/gcc/dbxout.c @@ -3189,7 +3189,7 @@ dbxout_common_check (tree decl, int *value) rtx sym_addr; const char *name = NULL; - /* If the decl isn't a VAR_DECL, or if it isn't public or static, or if + /* If the decl isn't a VAR_DECL, or if it isn't static, or if it does not have a value (the offset into the common area), or if it is thread local (as opposed to global) then it isn't common, and shouldn't be handled as such. @@ -3198,7 +3198,6 @@ dbxout_common_check (tree decl, int *value) for thread-local symbols. Can be handled via same mechanism as used in dwarf2out.c. */ if (TREE_CODE (decl) != VAR_DECL - || !TREE_PUBLIC(decl) || !TREE_STATIC(decl) || !DECL_HAS_VALUE_EXPR_P(decl) || DECL_THREAD_LOCAL_P (decl) diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 129ba7d..732b6a6 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -15621,12 +15621,11 @@ fortran_common (tree decl, HOST_WIDE_INT *value) tree offset; int volatilep = 0, unsignedp = 0; - /* If the decl isn't a VAR_DECL, or if it isn't public or static, or if + /* If the decl isn't a VAR_DECL, or if it isn't static, or if it does not have a value (the offset into the common area), or if it is thread local (as opposed to global) then it isn't common, and shouldn't be handled as such. */ if (TREE_CODE (decl) != VAR_DECL - || !TREE_PUBLIC (decl) || !TREE_STATIC (decl) || !DECL_HAS_VALUE_EXPR_P (decl) || !is_fortran ()) diff --git a/gcc/fortran/trans-common.c b/gcc/fortran/trans-common.c index 5b1952a..1fb3c40 100644 --- a/gcc/fortran/trans-common.c +++ b/gcc/fortran/trans-common.c @@ -680,7 +680,6 @@ create_common (gfc_common_head *com, segment_info *head, bool saw_equiv) var_decl = build_decl (s->sym->declared_at.lb->location, VAR_DECL, DECL_NAME (s->field), TREE_TYPE (s->field)); - TREE_PUBLIC (var_decl) = TREE_PUBLIC (decl); TREE_STATIC (var_decl) = TREE_STATIC (decl); TREE_USED (var_decl) = TREE_USED (decl); if (s->sym->attr.use_assoc) @@ -689,7 +688,9 @@ create_common (gfc_common_head *com, segment_info *head, bool saw_equiv) TREE_ADDRESSABLE (var_decl) = 1; /* This is a fake variable just for debugging purposes. */ TREE_ASM_WRITTEN (var_decl) = 1; - + /* Fake variables are not visible from other translation units. */ + TREE_PUBLIC (var_decl) = 0; + /* To preserve identifier names in COMMON, chain to procedure scope unless at top level in a module definition. */ if (com ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [patch] Fix PR41764 2009-10-28 4:24 ` Rafael Espindola @ 2009-10-28 14:27 ` Rafael Espindola 2009-10-28 19:20 ` Toon Moene 2009-10-28 14:34 ` Ian Lance Taylor 1 sibling, 1 reply; 9+ messages in thread From: Rafael Espindola @ 2009-10-28 14:27 UTC (permalink / raw) To: GCC Patches; +Cc: Richard Guenther, Diego Novillo, Fortran List Adding fortran@gcc.gnu.org > The joys of duplicated code... > > The attached patch fixes the PR, bootstraps and passes the regression > tests. Is it OK? > > gcc/ > 2009-10-27 Rafael Avila de Espindola <espindola@google.com> > > * dbxout.c (dbxout_common_check): Accept non public trees. > * dwarf2out.c (fortran_common): Accept non public trees. > > gcc/fortran/ > 2009-10-27 Rafael Avila de Espindola <espindola@google.com> > > * trans-common.c (create_common): Set TREE_PUBLIC to false on > fake variables. > > Cheers, > -- > Rafael Ávila de Espíndola > Cheers, -- Rafael Ávila de Espíndola ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [patch] Fix PR41764 2009-10-28 14:27 ` Rafael Espindola @ 2009-10-28 19:20 ` Toon Moene 2009-10-28 19:37 ` Rafael Espindola 0 siblings, 1 reply; 9+ messages in thread From: Toon Moene @ 2009-10-28 19:20 UTC (permalink / raw) To: Rafael Espindola Cc: GCC Patches, Richard Guenther, Diego Novillo, Fortran List Rafael Espindola wrote: > Adding fortran@gcc.gnu.org > >> The joys of duplicated code... >> >> The attached patch fixes the PR, bootstraps and passes the regression >> tests. Is it OK? It doesn't fix everything. I now get (gfortran is /usr/snp/bin/gfortran): gfortran hdf2asim.o /scratch/hirlam/hl_home/EXP/lib/src/linuxgfortran/lib/hdfg.a /scratch/hirlam/hl_home/EXP/lib/src/linuxgfortran/lib/port.a /scratch/hirlam/hl_home/EXP/lib/src/linuxgfortran/lib/gcod.a -o /scratch/hirlam/hl_home/EXP/lib/src/linuxgfortran/bin/hdf2asim.x -O3 -use-linker-plugin -ffast-math -fbacktrace -march=native -mtune=native -flto -fwhole-program --param max-inline-insns-single=10000000 --param max-inline-insns-auto=10000000 --param large-function-growth=100000 --param large-function-insns=10000000 --param large-stack-frame-growth=100000 --param large-stack-frame=1000000 -fdump-ipa-inline -llapack -lblas -lfftw3 -L/home/hirlam/hdf/lib -lmfhdf -ldf -ljpeg -lz -lm /usr/snp/lib/gcc/x86_64-unknown-linux-gnu/4.5.0/../../../../x86_64-unknown-linux-gnu/bin/ld: error: /scratch/hirlam/hl_home/EXP/lib/src/linuxgfortran/lib/port.a: multiple definition of casihl_ /usr/snp/lib/gcc/x86_64-unknown-linux-gnu/4.5.0/../../../../x86_64-unknown-linux-gnu/bin/ld: error: /scratch/hirlam/hl_home/EXP/lib/src/linuxgfortran/lib/port.a: previous definition here /usr/snp/lib/gcc/x86_64-unknown-linux-gnu/4.5.0/../../../../x86_64-unknown-linux-gnu/bin/ld: error: /scratch/hirlam/hl_home/EXP/lib/src/linuxgfortran/lib/port.a: multiple definition of cmachl_ /usr/snp/lib/gcc/x86_64-unknown-linux-gnu/4.5.0/../../../../x86_64-unknown-linux-gnu/bin/ld: error: /scratch/hirlam/hl_home/EXP/lib/src/linuxgfortran/lib/port.a: previous definition here /usr/snp/lib/gcc/x86_64-unknown-linux-gnu/4.5.0/../../../../x86_64-unknown-linux-gnu/bin/ld: error: /scratch/hirlam/hl_home/EXP/lib/src/linuxgfortran/lib/port.a: multiple definition of casihl_ /usr/snp/lib/gcc/x86_64-unknown-linux-gnu/4.5.0/../../../../x86_64-unknown-linux-gnu/bin/ld: error: /scratch/hirlam/hl_home/EXP/lib/src/linuxgfortran/lib/port.a: previous definition here /usr/snp/lib/gcc/x86_64-unknown-linux-gnu/4.5.0/../../../../x86_64-unknown-linux-gnu/bin/ld: error: /scratch/hirlam/hl_home/EXP/lib/src/linuxgfortran/lib/port.a: multiple definition of cmachl_ /usr/snp/lib/gcc/x86_64-unknown-linux-gnu/4.5.0/../../../../x86_64-unknown-linux-gnu/bin/ld: error: /scratch/hirlam/hl_home/EXP/lib/src/linuxgfortran/lib/port.a: previous definition here /usr/snp/lib/gcc/x86_64-unknown-linux-gnu/4.5.0/../../../../x86_64-unknown-linux-gnu/bin/ld: error: /scratch/hirlam/hl_home/EXP/lib/src/linuxgfortran/lib/port.a: multiple definition of casihl_ /usr/snp/lib/gcc/x86_64-unknown-linux-gnu/4.5.0/../../../../x86_64-unknown-linux-gnu/bin/ld: error: /scratch/hirlam/hl_home/EXP/lib/src/linuxgfortran/lib/port.a: previous definition here /usr/snp/lib/gcc/x86_64-unknown-linux-gnu/4.5.0/../../../../x86_64-unknown-linux-gnu/bin/ld: error: /scratch/hirlam/hl_home/EXP/lib/src/linuxgfortran/lib/port.a: multiple definition of cmachl_ /usr/snp/lib/gcc/x86_64-unknown-linux-gnu/4.5.0/../../../../x86_64-unknown-linux-gnu/bin/ld: error: /scratch/hirlam/hl_home/EXP/lib/src/linuxgfortran/lib/port.a: previous definition here /usr/snp/lib/gcc/x86_64-unknown-linux-gnu/4.5.0/../../../../x86_64-unknown-linux-gnu/bin/ld: error: /scratch/hirlam/hl_home/EXP/lib/src/linuxgfortran/lib/port.a: multiple definition of casihl_ /usr/snp/lib/gcc/x86_64-unknown-linux-gnu/4.5.0/../../../../x86_64-unknown-linux-gnu/bin/ld: error: /scratch/hirlam/hl_home/EXP/lib/src/linuxgfortran/lib/port.a: previous definition here /usr/snp/lib/gcc/x86_64-unknown-linux-gnu/4.5.0/../../../../x86_64-unknown-linux-gnu/bin/ld: error: /scratch/hirlam/hl_home/EXP/lib/src/linuxgfortran/lib/port.a: multiple definition of cmachl_ /usr/snp/lib/gcc/x86_64-unknown-linux-gnu/4.5.0/../../../../x86_64-unknown-linux-gnu/bin/ld: error: /scratch/hirlam/hl_home/EXP/lib/src/linuxgfortran/lib/port.a: previous definition here /usr/snp/lib/gcc/x86_64-unknown-linux-gnu/4.5.0/../../../../x86_64-unknown-linux-gnu/bin/ld: error: /scratch/hirlam/hl_home/EXP/lib/src/linuxgfortran/lib/gcod.a: multiple definition of grbcom_ /usr/snp/lib/gcc/x86_64-unknown-linux-gnu/4.5.0/../../../../x86_64-unknown-linux-gnu/bin/ld: error: /scratch/hirlam/hl_home/EXP/lib/src/linuxgfortran/lib/gcod.a: previous definition here /usr/snp/lib/gcc/x86_64-unknown-linux-gnu/4.5.0/../../../../x86_64-unknown-linux-gnu/bin/ld: error: /scratch/hirlam/hl_home/EXP/lib/src/linuxgfortran/lib/gcod.a: multiple definition of grbcom_ /usr/snp/lib/gcc/x86_64-unknown-linux-gnu/4.5.0/../../../../x86_64-unknown-linux-gnu/bin/ld: error: /scratch/hirlam/hl_home/EXP/lib/src/linuxgfortran/lib/gcod.a: previous definition here collect2: ld returned 1 exit status make[1]: *** [/scratch/hirlam/hl_home/EXP/lib/src/linuxgfortran/bin/hdf2asim.x] Error 1 So the common blocks themselves (not the variables in it) are still multiply defined. -- Toon Moene - e-mail: toon@moene.org - phone: +31 346 214290 Saturnushof 14, 3738 XG Maartensdijk, The Netherlands At home: http://moene.org/~toon/ Progress of GNU Fortran: http://gcc.gnu.org/gcc-4.5/changes.html ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [patch] Fix PR41764 2009-10-28 19:20 ` Toon Moene @ 2009-10-28 19:37 ` Rafael Espindola 0 siblings, 0 replies; 9+ messages in thread From: Rafael Espindola @ 2009-10-28 19:37 UTC (permalink / raw) To: Toon Moene; +Cc: GCC Patches, Richard Guenther, Diego Novillo, Fortran List > It doesn't fix everything. I now get (gfortran is /usr/snp/bin/gfortran): > .... > > So the common blocks themselves (not the variables in it) are still multiply > defined. Can you provide me with a testcase? I don't know fortran, so if the testcase is already reduce it it would be very nice :-) > -- > Toon Moene - e-mail: toon@moene.org - phone: +31 346 214290 > Saturnushof 14, 3738 XG Maartensdijk, The Netherlands > At home: http://moene.org/~toon/ > Progress of GNU Fortran: http://gcc.gnu.org/gcc-4.5/changes.html > Thanks, -- Rafael Ávila de Espíndola ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [patch] Fix PR41764 2009-10-28 4:24 ` Rafael Espindola 2009-10-28 14:27 ` Rafael Espindola @ 2009-10-28 14:34 ` Ian Lance Taylor 2009-10-28 20:38 ` Tobias Burnus 1 sibling, 1 reply; 9+ messages in thread From: Ian Lance Taylor @ 2009-10-28 14:34 UTC (permalink / raw) To: Rafael Espindola Cc: GCC Patches, Richard Guenther, Diego Novillo, Paul Brook, fortran Rafael Espindola <espindola@google.com> writes: > gcc/ > 2009-10-27 Rafael Avila de Espindola <espindola@google.com> > > * dbxout.c (dbxout_common_check): Accept non public trees. > * dwarf2out.c (fortran_common): Accept non public trees. > > gcc/fortran/ > 2009-10-27 Rafael Avila de Espindola <espindola@google.com> > > * trans-common.c (create_common): Set TREE_PUBLIC to false on > fake variables. The middle-end parts of this patch are OK. This is OK if the Fortran maintainers are OK with the change to trans-common.c. Thanks. > diff --git a/gcc/dbxout.c b/gcc/dbxout.c > index b5688d9..0bf5e3c 100644 > --- a/gcc/dbxout.c > +++ b/gcc/dbxout.c > @@ -3189,7 +3189,7 @@ dbxout_common_check (tree decl, int *value) > rtx sym_addr; > const char *name = NULL; > > - /* If the decl isn't a VAR_DECL, or if it isn't public or static, or if > + /* If the decl isn't a VAR_DECL, or if it isn't static, or if > it does not have a value (the offset into the common area), or if it > is thread local (as opposed to global) then it isn't common, and shouldn't > be handled as such. > @@ -3198,7 +3198,6 @@ dbxout_common_check (tree decl, int *value) > for thread-local symbols. Can be handled via same mechanism as used > in dwarf2out.c. */ > if (TREE_CODE (decl) != VAR_DECL > - || !TREE_PUBLIC(decl) > || !TREE_STATIC(decl) > || !DECL_HAS_VALUE_EXPR_P(decl) > || DECL_THREAD_LOCAL_P (decl) > diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c > index 129ba7d..732b6a6 100644 > --- a/gcc/dwarf2out.c > +++ b/gcc/dwarf2out.c > @@ -15621,12 +15621,11 @@ fortran_common (tree decl, HOST_WIDE_INT *value) > tree offset; > int volatilep = 0, unsignedp = 0; > > - /* If the decl isn't a VAR_DECL, or if it isn't public or static, or if > + /* If the decl isn't a VAR_DECL, or if it isn't static, or if > it does not have a value (the offset into the common area), or if it > is thread local (as opposed to global) then it isn't common, and shouldn't > be handled as such. */ > if (TREE_CODE (decl) != VAR_DECL > - || !TREE_PUBLIC (decl) > || !TREE_STATIC (decl) > || !DECL_HAS_VALUE_EXPR_P (decl) > || !is_fortran ()) > diff --git a/gcc/fortran/trans-common.c b/gcc/fortran/trans-common.c > index 5b1952a..1fb3c40 100644 > --- a/gcc/fortran/trans-common.c > +++ b/gcc/fortran/trans-common.c > @@ -680,7 +680,6 @@ create_common (gfc_common_head *com, segment_info *head, bool saw_equiv) > var_decl = build_decl (s->sym->declared_at.lb->location, > VAR_DECL, DECL_NAME (s->field), > TREE_TYPE (s->field)); > - TREE_PUBLIC (var_decl) = TREE_PUBLIC (decl); > TREE_STATIC (var_decl) = TREE_STATIC (decl); > TREE_USED (var_decl) = TREE_USED (decl); > if (s->sym->attr.use_assoc) > @@ -689,7 +688,9 @@ create_common (gfc_common_head *com, segment_info *head, bool saw_equiv) > TREE_ADDRESSABLE (var_decl) = 1; > /* This is a fake variable just for debugging purposes. */ > TREE_ASM_WRITTEN (var_decl) = 1; > - > + /* Fake variables are not visible from other translation units. */ > + TREE_PUBLIC (var_decl) = 0; > + > /* To preserve identifier names in COMMON, chain to procedure > scope unless at top level in a module definition. */ > if (com ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [patch] Fix PR41764 2009-10-28 14:34 ` Ian Lance Taylor @ 2009-10-28 20:38 ` Tobias Burnus 0 siblings, 0 replies; 9+ messages in thread From: Tobias Burnus @ 2009-10-28 20:38 UTC (permalink / raw) To: Ian Lance Taylor Cc: Rafael Espindola, GCC Patches, Richard Guenther, Diego Novillo, Paul Brook, fortran Ian Lance Taylor wrote: > Rafael Espindola <espindola@google.com> writes >> gcc/ >> 2009-10-27 Rafael Avila de Espindola <espindola@google.com> >> >> * dbxout.c (dbxout_common_check): Accept non public trees. >> * dwarf2out.c (fortran_common): Accept non public trees. >> >> gcc/fortran/ >> 2009-10-27 Rafael Avila de Espindola <espindola@google.com> >> >> * trans-common.c (create_common): Set TREE_PUBLIC to false on >> fake variables. >> > The middle-end parts of this patch are OK. > > This is OK if the Fortran maintainers are OK with the change to > trans-common.c. > Sorry for the delay. The Fortran part is also OK. Tobias >> --- a/gcc/fortran/trans-common.c >> +++ b/gcc/fortran/trans-common.c >> @@ -680,7 +680,6 @@ create_common (gfc_common_head *com, segment_info *head, bool saw_equiv) >> var_decl = build_decl (s->sym->declared_at.lb->location, >> VAR_DECL, DECL_NAME (s->field), >> TREE_TYPE (s->field)); >> - TREE_PUBLIC (var_decl) = TREE_PUBLIC (decl); >> TREE_STATIC (var_decl) = TREE_STATIC (decl); >> TREE_USED (var_decl) = TREE_USED (decl); >> if (s->sym->attr.use_assoc) >> @@ -689,7 +688,9 @@ create_common (gfc_common_head *com, segment_info *head, bool saw_equiv) >> TREE_ADDRESSABLE (var_decl) = 1; >> /* This is a fake variable just for debugging purposes. */ >> TREE_ASM_WRITTEN (var_decl) = 1; >> - >> + /* Fake variables are not visible from other translation units. */ >> + TREE_PUBLIC (var_decl) = 0; >> + >> /* To preserve identifier names in COMMON, chain to procedure >> scope unless at top level in a module definition. */ >> if (com >> > ^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2009-10-28 20:03 UTC | newest] Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2009-10-21 18:09 [patch] Fix PR41764 Rafael Espindola 2009-10-21 22:46 ` Rafael Espindola 2009-10-26 18:53 ` Rafael Espindola 2009-10-28 4:24 ` Rafael Espindola 2009-10-28 14:27 ` Rafael Espindola 2009-10-28 19:20 ` Toon Moene 2009-10-28 19:37 ` Rafael Espindola 2009-10-28 14:34 ` Ian Lance Taylor 2009-10-28 20:38 ` Tobias Burnus
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).