public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "strasbur at chkw386 dot ch.pwr.wroc.pl" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c/58270] Wrong code while accessing array elements in a global structure Date: Thu, 29 Aug 2013 11:15:00 -0000 [thread overview] Message-ID: <bug-58270-4-mvnRaqKFdy@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-58270-4@http.gcc.gnu.org/bugzilla/> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58270 --- Comment #2 from Krzysztof Strasburger <strasbur at chkw386 dot ch.pwr.wroc.pl> --- OK, I'm not and expert, but mem is a global structure and it can be of different size in other object file. The linker should assume the biggest of all, correct? The example I posted comes from f2c-translated FORTRAN77 code (it is cleared from f2c references). It was a normal practice to mix C with FORTRAN for dynamic memory allocation. The memory allocated via malloc() was referenced to a small (one-element) static array. There was nothing illegal with this. And how can the compiler assume freely that both i1 and i2 are zeros, if they are passed as actual arguments?
next prev parent reply other threads:[~2013-08-29 11:15 UTC|newest] Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top 2013-08-29 10:48 [Bug c/58270] New: Wrong code accessing array elements strasbur at chkw386 dot ch.pwr.wroc.pl 2013-08-29 10:58 ` [Bug c/58270] Wrong code while accessing array elements in a global structure fweimer at redhat dot com 2013-08-29 11:15 ` strasbur at chkw386 dot ch.pwr.wroc.pl [this message] 2013-08-29 11:29 ` strasbur at chkw386 dot ch.pwr.wroc.pl 2013-08-29 12:19 ` strasbur at chkw386 dot ch.pwr.wroc.pl 2013-08-29 12:21 ` strasbur at chkw386 dot ch.pwr.wroc.pl 2013-08-29 12:23 ` strasbur at chkw386 dot ch.pwr.wroc.pl 2013-08-29 12:39 ` mikpe at it dot uu.se 2013-08-29 13:32 ` strasbur at chkw386 dot ch.pwr.wroc.pl 2013-08-29 14:48 ` jakub at gcc dot gnu.org 2013-08-29 16:23 ` strasbur at chkw386 dot ch.pwr.wroc.pl 2013-09-02 8:20 ` strasbur at chkw386 dot ch.pwr.wroc.pl 2013-09-02 8:24 ` strasbur at chkw386 dot ch.pwr.wroc.pl 2013-09-02 12:21 ` [Bug fortran/58270] " dominiq at lps dot ens.fr 2013-09-02 13:14 ` strasbur at chkw386 dot ch.pwr.wroc.pl 2013-09-02 14:39 ` dominiq at lps dot ens.fr 2013-09-02 16:32 ` strasbur at chkw386 dot ch.pwr.wroc.pl 2013-09-02 17:53 ` dominiq at lps dot ens.fr 2013-09-03 7:56 ` strasbur at chkw386 dot ch.pwr.wroc.pl 2013-09-03 9:23 ` [Bug middle-end/58270] Wrong code while accessing trailing array elements in a global common structure rguenth at gcc dot gnu.org 2013-09-03 9:41 ` dominiq at lps dot ens.fr 2013-09-03 9:48 ` dominiq at lps dot ens.fr 2021-11-29 2:32 ` pinskia at gcc dot gnu.org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-58270-4-mvnRaqKFdy@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).