public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
* [Bug middle-end/24590] Static function named "main" treated as the real main [not found] <bug-24590-4@http.gcc.gnu.org/bugzilla/> @ 2021-08-08 21:30 ` pinskia at gcc dot gnu.org 0 siblings, 0 replies; 5+ messages in thread From: pinskia at gcc dot gnu.org @ 2021-08-08 21:30 UTC (permalink / raw) To: gcc-bugs https://gcc.gnu.org/bugzilla/show_bug.cgi?id=24590 --- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> --- config/frv/frv.h:#define INVOKE__main config/rs6000/eabi.h:#define INVOKE__main I think the other ones that invokve __main is mingw/cygwin targets. I wonder if there is a way to get rid of this really. ^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug middle-end/24590] New: Static function named "main" treated as the real main @ 2005-10-31 6:29 mmitchel at gcc dot gnu dot org 2005-10-31 6:29 ` [Bug middle-end/24590] " mmitchel at gcc dot gnu dot org ` (3 more replies) 0 siblings, 4 replies; 5+ messages in thread From: mmitchel at gcc dot gnu dot org @ 2005-10-31 6:29 UTC (permalink / raw) To: gcc-bugs In tree_expand_cfg, we have: if (DECL_NAME (current_function_decl) && MAIN_NAME_P (DECL_NAME (current_function_decl)) && DECL_FILE_SCOPE_P (current_function_decl)) expand_main_function (); This code should also check TREE_PUBLIC (c_f_d) (and the entire predicate should probably be encapsulated in a macro or function). Compiling this test case: extern void f(); static int main () { f(); } int g() { f(); } on x86_64-unknown-linux-gnu with -m32 shows that the usual stack-alignment and implicit return of zero code is generated for this "main" function, even though it's not the real main function. -- Summary: Static function named "main" treated as the real main Product: gcc Version: 4.1.0 Status: UNCONFIRMED Keywords: wrong-code Severity: normal Priority: P3 Component: middle-end AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: mmitchel at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24590 ^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug middle-end/24590] Static function named "main" treated as the real main 2005-10-31 6:29 [Bug middle-end/24590] New: " mmitchel at gcc dot gnu dot org @ 2005-10-31 6:29 ` mmitchel at gcc dot gnu dot org 2005-10-31 15:45 ` pinskia at gcc dot gnu dot org ` (2 subsequent siblings) 3 siblings, 0 replies; 5+ messages in thread From: mmitchel at gcc dot gnu dot org @ 2005-10-31 6:29 UTC (permalink / raw) To: gcc-bugs ------- Comment #1 from mmitchel at gcc dot gnu dot org 2005-10-31 06:29 ------- Wrong code, easy fix -- showstopper. -- mmitchel at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- Priority|P3 |P1 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24590 ^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug middle-end/24590] Static function named "main" treated as the real main 2005-10-31 6:29 [Bug middle-end/24590] New: " mmitchel at gcc dot gnu dot org 2005-10-31 6:29 ` [Bug middle-end/24590] " mmitchel at gcc dot gnu dot org @ 2005-10-31 15:45 ` pinskia at gcc dot gnu dot org 2006-01-29 17:49 ` pinskia at gcc dot gnu dot org 2006-01-29 17:50 ` pinskia at gcc dot gnu dot org 3 siblings, 0 replies; 5+ messages in thread From: pinskia at gcc dot gnu dot org @ 2005-10-31 15:45 UTC (permalink / raw) To: gcc-bugs ------- Comment #2 from pinskia at gcc dot gnu dot org 2005-10-31 15:45 ------- Hmm: http://gcc.gnu.org/ml/gcc/2004-10/msg00038.html So maybe this is undefined. I think we should wait for the committe to decide this one before changing anything here. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24590 ^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug middle-end/24590] Static function named "main" treated as the real main 2005-10-31 6:29 [Bug middle-end/24590] New: " mmitchel at gcc dot gnu dot org 2005-10-31 6:29 ` [Bug middle-end/24590] " mmitchel at gcc dot gnu dot org 2005-10-31 15:45 ` pinskia at gcc dot gnu dot org @ 2006-01-29 17:49 ` pinskia at gcc dot gnu dot org 2006-01-29 17:50 ` pinskia at gcc dot gnu dot org 3 siblings, 0 replies; 5+ messages in thread From: pinskia at gcc dot gnu dot org @ 2006-01-29 17:49 UTC (permalink / raw) To: gcc-bugs ------- Comment #3 from pinskia at gcc dot gnu dot org 2006-01-29 17:49 ------- Confirmed, to ... -- pinskia at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Ever Confirmed|0 |1 Last reconfirmed|0000-00-00 00:00:00 |2006-01-29 17:49:55 date| | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24590 ^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug middle-end/24590] Static function named "main" treated as the real main 2005-10-31 6:29 [Bug middle-end/24590] New: " mmitchel at gcc dot gnu dot org ` (2 preceding siblings ...) 2006-01-29 17:49 ` pinskia at gcc dot gnu dot org @ 2006-01-29 17:50 ` pinskia at gcc dot gnu dot org 3 siblings, 0 replies; 5+ messages in thread From: pinskia at gcc dot gnu dot org @ 2006-01-29 17:50 UTC (permalink / raw) To: gcc-bugs ------- Comment #4 from pinskia at gcc dot gnu dot org 2006-01-29 17:50 ------- Suspend based on the Pre-DR. -- pinskia at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |SUSPENDED http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24590 ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2021-08-08 21:30 UTC | newest] Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- [not found] <bug-24590-4@http.gcc.gnu.org/bugzilla/> 2021-08-08 21:30 ` [Bug middle-end/24590] Static function named "main" treated as the real main pinskia at gcc dot gnu.org 2005-10-31 6:29 [Bug middle-end/24590] New: " mmitchel at gcc dot gnu dot org 2005-10-31 6:29 ` [Bug middle-end/24590] " mmitchel at gcc dot gnu dot org 2005-10-31 15:45 ` pinskia at gcc dot gnu dot org 2006-01-29 17:49 ` pinskia at gcc dot gnu dot org 2006-01-29 17:50 ` pinskia at gcc dot gnu dot org
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).