On Fri, 2022-08-19 at 09:56 +0800, Lulu Cheng wrote:
> v1 -> v2:
> - Modify some description information.
> - Add options -W[no]extreme-plt, warn about code model extreme not support 
> plt mode,
> and then disable plt.

I think we can make -mcmodel=large imply -fno-plt, and reject if user
uses "-fplt -mcmodel=large" explicitly:

diff --git a/gcc/config/loongarch/loongarch.cc 
b/gcc/config/loongarch/loongarch.cc
index 114ff8ec836..25483da0f44 100644
--- a/gcc/config/loongarch/loongarch.cc
+++ b/gcc/config/loongarch/loongarch.cc
@@ -5961,9 +5961,8 @@ loongarch_option_override_internal (struct gcc_options 
*opts)
 
        if (opts->x_flag_plt)
          {
-           warning (OPT_Wextreme_plt, "code model %qs not support %s mode,"
-                    "now set to %s",
-                    "extreme", "plt", "noplt");
+           if (global_options_set.x_flag_plt)
+             error ("code model %qs is not compatible with %s", "-fplt");
            opts->x_flag_plt = 0;
          }
        break;

-- 
Xi Ruoyao <xry...@xry111.site>
School of Aerospace Science and Technology, Xidian University

Reply via email to