public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/users/marxin/heads/optimize-target-add-to-cmdline-v2)] Append target/optimize attr to the current cmdline.
@ 2021-06-28 14:53 Martin Liska
0 siblings, 0 replies; 3+ messages in thread
From: Martin Liska @ 2021-06-28 14:53 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:b65e76b7c7dd2b38ce4aa2852d72b4b07cab62c8
commit b65e76b7c7dd2b38ce4aa2852d72b4b07cab62c8
Author: Martin Liska <mliska@suse.cz>
Date: Wed Jun 2 08:44:37 2021 +0200
Append target/optimize attr to the current cmdline.
gcc/c-family/ChangeLog:
* c-common.c (parse_optimize_options): Combine optimize
options with what was provided on the command line.
gcc/ChangeLog:
* toplev.c (toplev::main): Save decoded optimization options.
* toplev.h (save_opt_decoded_options): New.
gcc/testsuite/ChangeLog:
* gcc.target/i386/avx512er-vrsqrt28ps-3.c: Disable fast math.
* gcc.target/i386/avx512er-vrsqrt28ps-5.c: Likewise.
* gcc.target/i386/attr-optimize.c: New test.
Diff:
---
gcc/c-family/c-common.c | 17 +++++++++++++--
gcc/testsuite/gcc.target/i386/attr-optimize.c | 24 ++++++++++++++++++++++
.../gcc.target/i386/avx512er-vrsqrt28ps-3.c | 2 +-
.../gcc.target/i386/avx512er-vrsqrt28ps-5.c | 2 +-
gcc/toplev.c | 8 ++++++++
gcc/toplev.h | 1 +
6 files changed, 50 insertions(+), 4 deletions(-)
diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c
index 681fcc972f4..f4e56653585 100644
--- a/gcc/c-family/c-common.c
+++ b/gcc/c-family/c-common.c
@@ -5901,9 +5901,22 @@ parse_optimize_options (tree args, bool attr_p)
j++;
}
decoded_options_count = j;
- /* And apply them. */
+
+ /* Merge the decoded options with save_decoded_options. */
+ unsigned save_opt_count = save_opt_decoded_options.length ();
+ unsigned merged_decoded_options_count
+ = save_opt_count + decoded_options_count;
+ cl_decoded_option *merged_decoded_options
+ = XNEWVEC (cl_decoded_option, merged_decoded_options_count);
+
+ for (unsigned i = 0; i < save_opt_count; ++i)
+ merged_decoded_options[i] = save_opt_decoded_options[i];
+ for (unsigned i = 0; i < decoded_options_count; ++i)
+ merged_decoded_options[save_opt_count + i] = decoded_options[i];
+
+ /* And apply them. */
decode_options (&global_options, &global_options_set,
- decoded_options, decoded_options_count,
+ merged_decoded_options, merged_decoded_options_count,
input_location, global_dc, NULL);
free (decoded_options);
diff --git a/gcc/testsuite/gcc.target/i386/attr-optimize.c b/gcc/testsuite/gcc.target/i386/attr-optimize.c
new file mode 100644
index 00000000000..f5db028f1fd
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/attr-optimize.c
@@ -0,0 +1,24 @@
+/* { dg-do compile } */
+/* { dg-additional-options "-O1 -ftree-slp-vectorize -march=znver1 -fdump-tree-optimized" } */
+
+/* Use -O2, but -ftree-slp-vectorize option should be preserved and used. */
+#pragma GCC optimize "-O2"
+
+typedef struct {
+ long n[4];
+} secp256k1_fe;
+
+void *a;
+int c;
+static void
+fn1(secp256k1_fe *p1, int p2)
+{
+ p1->n[0] = p1->n[1] = p2;
+}
+void
+fn2()
+{
+ fn1(a, !c);
+}
+
+/* { dg-final { scan-tree-dump { MEM <vector\(2\) long int> \[[^]]*\] = } "optimized" } } */
diff --git a/gcc/testsuite/gcc.target/i386/avx512er-vrsqrt28ps-3.c b/gcc/testsuite/gcc.target/i386/avx512er-vrsqrt28ps-3.c
index 1ba8172d6e3..40aefb50844 100644
--- a/gcc/testsuite/gcc.target/i386/avx512er-vrsqrt28ps-3.c
+++ b/gcc/testsuite/gcc.target/i386/avx512er-vrsqrt28ps-3.c
@@ -8,7 +8,7 @@
#define MAX 1000
#define EPS 0.00001
-__attribute__ ((noinline, optimize (1)))
+__attribute__ ((noinline, optimize (1, "-fno-fast-math")))
void static
compute_rsqrt_ref (float *a, float *r)
{
diff --git a/gcc/testsuite/gcc.target/i386/avx512er-vrsqrt28ps-5.c b/gcc/testsuite/gcc.target/i386/avx512er-vrsqrt28ps-5.c
index e067a81e562..498f4d50aa5 100644
--- a/gcc/testsuite/gcc.target/i386/avx512er-vrsqrt28ps-5.c
+++ b/gcc/testsuite/gcc.target/i386/avx512er-vrsqrt28ps-5.c
@@ -8,7 +8,7 @@
#define MAX 1000
#define EPS 0.00001
-__attribute__ ((noinline, optimize (1)))
+__attribute__ ((noinline, optimize (1, "-fno-fast-math")))
void static
compute_sqrt_ref (float *a, float *r)
{
diff --git a/gcc/toplev.c b/gcc/toplev.c
index 55e7550151f..55df8a60997 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -120,6 +120,9 @@ static bool no_backend;
struct cl_decoded_option *save_decoded_options;
unsigned int save_decoded_options_count;
+/* Vector of saved Optimization decoded command line options. */
+auto_vec<cl_decoded_option> save_opt_decoded_options;
+
/* Used to enable -fvar-tracking, -fweb and -frename-registers according
to optimize in process_options (). */
#define AUTODETECT_VALUE 2
@@ -2319,6 +2322,11 @@ toplev::main (int argc, char **argv)
&save_decoded_options,
&save_decoded_options_count);
+ /* Save Optimization decoded options. */
+ for (unsigned i = 0; i < save_decoded_options_count; ++i)
+ if (cl_options[save_decoded_options[i].opt_index].flags & CL_OPTIMIZATION)
+ save_opt_decoded_options.safe_push (save_decoded_options[i]);
+
/* Perform language-specific options initialization. */
lang_hooks.init_options (save_decoded_options_count, save_decoded_options);
diff --git a/gcc/toplev.h b/gcc/toplev.h
index 175944c85b7..9a1d2e6986f 100644
--- a/gcc/toplev.h
+++ b/gcc/toplev.h
@@ -23,6 +23,7 @@ along with GCC; see the file COPYING3. If not see
/* Decoded options, and number of such options. */
extern struct cl_decoded_option *save_decoded_options;
extern unsigned int save_decoded_options_count;
+extern auto_vec<cl_decoded_option> save_opt_decoded_options;
class timer;
^ permalink raw reply [flat|nested] 3+ messages in thread
* [gcc(refs/users/marxin/heads/optimize-target-add-to-cmdline-v2)] Append target/optimize attr to the current cmdline.
@ 2021-08-24 14:39 Martin Liska
0 siblings, 0 replies; 3+ messages in thread
From: Martin Liska @ 2021-08-24 14:39 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:cc58d983df5a1e8ecbbcd6b5aaac3bbd0727c8d0
commit cc58d983df5a1e8ecbbcd6b5aaac3bbd0727c8d0
Author: Martin Liska <mliska@suse.cz>
Date: Wed Jun 2 08:44:37 2021 +0200
Append target/optimize attr to the current cmdline.
gcc/c-family/ChangeLog:
* c-common.c (parse_optimize_options): Combine optimize
options with what was provided on the command line.
gcc/ChangeLog:
* toplev.c (toplev::main): Save decoded optimization options.
* toplev.h (save_opt_decoded_options): New.
* doc/extend.texi: Be more clear about optimize and target
attributes.
gcc/testsuite/ChangeLog:
* gcc.target/i386/avx512er-vrsqrt28ps-3.c: Disable fast math.
* gcc.target/i386/avx512er-vrsqrt28ps-5.c: Likewise.
* gcc.target/i386/attr-optimize.c: New test.
Diff:
---
gcc/c-family/c-common.c | 17 +++++++++++++--
gcc/doc/extend.texi | 8 ++++++--
gcc/testsuite/gcc.target/i386/attr-optimize.c | 24 ++++++++++++++++++++++
.../gcc.target/i386/avx512er-vrsqrt28ps-3.c | 2 +-
.../gcc.target/i386/avx512er-vrsqrt28ps-5.c | 2 +-
gcc/toplev.c | 8 ++++++++
gcc/toplev.h | 1 +
7 files changed, 56 insertions(+), 6 deletions(-)
diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c
index 017e41537ac..09038e3175f 100644
--- a/gcc/c-family/c-common.c
+++ b/gcc/c-family/c-common.c
@@ -5904,9 +5904,22 @@ parse_optimize_options (tree args, bool attr_p)
j++;
}
decoded_options_count = j;
- /* And apply them. */
+
+ /* Merge the decoded options with save_decoded_options. */
+ unsigned save_opt_count = save_opt_decoded_options.length ();
+ unsigned merged_decoded_options_count
+ = save_opt_count + decoded_options_count;
+ cl_decoded_option *merged_decoded_options
+ = XNEWVEC (cl_decoded_option, merged_decoded_options_count);
+
+ for (unsigned i = 0; i < save_opt_count; ++i)
+ merged_decoded_options[i] = save_opt_decoded_options[i];
+ for (unsigned i = 0; i < decoded_options_count; ++i)
+ merged_decoded_options[save_opt_count + i] = decoded_options[i];
+
+ /* And apply them. */
decode_options (&global_options, &global_options_set,
- decoded_options, decoded_options_count,
+ merged_decoded_options, merged_decoded_options_count,
input_location, global_dc, NULL);
free (decoded_options);
diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi
index 49df8e6dc38..ca673bd3acf 100644
--- a/gcc/doc/extend.texi
+++ b/gcc/doc/extend.texi
@@ -3613,7 +3613,10 @@ take function pointer arguments.
@cindex @code{optimize} function attribute
The @code{optimize} attribute is used to specify that a function is to
be compiled with different optimization options than specified on the
-command line. Valid arguments are constant non-negative integers and
+command line. The optimize attribute arguments of a function behave
+as if they were added to the command line options.
+
+Valid arguments are constant non-negative integers and
strings. Each numeric argument specifies an optimization @var{level}.
Each @var{string} argument consists of one or more comma-separated
substrings. Each substring that begins with the letter @code{O} refers
@@ -3817,7 +3820,8 @@ This attribute prevents stack protection code for the function.
Multiple target back ends implement the @code{target} attribute
to specify that a function is to
be compiled with different target options than specified on the
-command line. One or more strings can be provided as arguments.
+command line. The original target command line options are ignored.
+One or more strings can be provided as arguments.
Each string consists of one or more comma-separated suffixes to
the @code{-m} prefix jointly forming the name of a machine-dependent
option. @xref{Submodel Options,,Machine-Dependent Options}.
diff --git a/gcc/testsuite/gcc.target/i386/attr-optimize.c b/gcc/testsuite/gcc.target/i386/attr-optimize.c
new file mode 100644
index 00000000000..f5db028f1fd
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/attr-optimize.c
@@ -0,0 +1,24 @@
+/* { dg-do compile } */
+/* { dg-additional-options "-O1 -ftree-slp-vectorize -march=znver1 -fdump-tree-optimized" } */
+
+/* Use -O2, but -ftree-slp-vectorize option should be preserved and used. */
+#pragma GCC optimize "-O2"
+
+typedef struct {
+ long n[4];
+} secp256k1_fe;
+
+void *a;
+int c;
+static void
+fn1(secp256k1_fe *p1, int p2)
+{
+ p1->n[0] = p1->n[1] = p2;
+}
+void
+fn2()
+{
+ fn1(a, !c);
+}
+
+/* { dg-final { scan-tree-dump { MEM <vector\(2\) long int> \[[^]]*\] = } "optimized" } } */
diff --git a/gcc/testsuite/gcc.target/i386/avx512er-vrsqrt28ps-3.c b/gcc/testsuite/gcc.target/i386/avx512er-vrsqrt28ps-3.c
index 1ba8172d6e3..40aefb50844 100644
--- a/gcc/testsuite/gcc.target/i386/avx512er-vrsqrt28ps-3.c
+++ b/gcc/testsuite/gcc.target/i386/avx512er-vrsqrt28ps-3.c
@@ -8,7 +8,7 @@
#define MAX 1000
#define EPS 0.00001
-__attribute__ ((noinline, optimize (1)))
+__attribute__ ((noinline, optimize (1, "-fno-fast-math")))
void static
compute_rsqrt_ref (float *a, float *r)
{
diff --git a/gcc/testsuite/gcc.target/i386/avx512er-vrsqrt28ps-5.c b/gcc/testsuite/gcc.target/i386/avx512er-vrsqrt28ps-5.c
index e067a81e562..498f4d50aa5 100644
--- a/gcc/testsuite/gcc.target/i386/avx512er-vrsqrt28ps-5.c
+++ b/gcc/testsuite/gcc.target/i386/avx512er-vrsqrt28ps-5.c
@@ -8,7 +8,7 @@
#define MAX 1000
#define EPS 0.00001
-__attribute__ ((noinline, optimize (1)))
+__attribute__ ((noinline, optimize (1, "-fno-fast-math")))
void static
compute_sqrt_ref (float *a, float *r)
{
diff --git a/gcc/toplev.c b/gcc/toplev.c
index 14d1335e79e..538ffdbd31a 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -121,6 +121,9 @@ static bool no_backend;
struct cl_decoded_option *save_decoded_options;
unsigned int save_decoded_options_count;
+/* Vector of saved Optimization decoded command line options. */
+auto_vec<cl_decoded_option> save_opt_decoded_options;
+
/* Used to enable -fvar-tracking, -fweb and -frename-registers according
to optimize in process_options (). */
#define AUTODETECT_VALUE 2
@@ -2342,6 +2345,11 @@ toplev::main (int argc, char **argv)
&save_decoded_options,
&save_decoded_options_count);
+ /* Save Optimization decoded options. */
+ for (unsigned i = 0; i < save_decoded_options_count; ++i)
+ if (cl_options[save_decoded_options[i].opt_index].flags & CL_OPTIMIZATION)
+ save_opt_decoded_options.safe_push (save_decoded_options[i]);
+
/* Perform language-specific options initialization. */
lang_hooks.init_options (save_decoded_options_count, save_decoded_options);
diff --git a/gcc/toplev.h b/gcc/toplev.h
index f543554b15f..c44c5ff926a 100644
--- a/gcc/toplev.h
+++ b/gcc/toplev.h
@@ -23,6 +23,7 @@ along with GCC; see the file COPYING3. If not see
/* Decoded options, and number of such options. */
extern struct cl_decoded_option *save_decoded_options;
extern unsigned int save_decoded_options_count;
+extern auto_vec<cl_decoded_option> save_opt_decoded_options;
class timer;
^ permalink raw reply [flat|nested] 3+ messages in thread
* [gcc(refs/users/marxin/heads/optimize-target-add-to-cmdline-v2)] Append target/optimize attr to the current cmdline.
@ 2021-07-01 12:58 Martin Liska
0 siblings, 0 replies; 3+ messages in thread
From: Martin Liska @ 2021-07-01 12:58 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:eaa1892cbe32c6fe73de7708aa17be2d3917bceb
commit eaa1892cbe32c6fe73de7708aa17be2d3917bceb
Author: Martin Liska <mliska@suse.cz>
Date: Wed Jun 2 08:44:37 2021 +0200
Append target/optimize attr to the current cmdline.
gcc/c-family/ChangeLog:
* c-common.c (parse_optimize_options): Combine optimize
options with what was provided on the command line.
gcc/ChangeLog:
* toplev.c (toplev::main): Save decoded optimization options.
* toplev.h (save_opt_decoded_options): New.
* doc/extend.texi: Be more clear about optimize and target
attributes.
gcc/testsuite/ChangeLog:
* gcc.target/i386/avx512er-vrsqrt28ps-3.c: Disable fast math.
* gcc.target/i386/avx512er-vrsqrt28ps-5.c: Likewise.
* gcc.target/i386/attr-optimize.c: New test.
Diff:
---
gcc/c-family/c-common.c | 17 +++++++++++++--
gcc/doc/extend.texi | 8 ++++++--
gcc/testsuite/gcc.target/i386/attr-optimize.c | 24 ++++++++++++++++++++++
.../gcc.target/i386/avx512er-vrsqrt28ps-3.c | 2 +-
.../gcc.target/i386/avx512er-vrsqrt28ps-5.c | 2 +-
gcc/toplev.c | 8 ++++++++
gcc/toplev.h | 1 +
7 files changed, 56 insertions(+), 6 deletions(-)
diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c
index 681fcc972f4..f4e56653585 100644
--- a/gcc/c-family/c-common.c
+++ b/gcc/c-family/c-common.c
@@ -5901,9 +5901,22 @@ parse_optimize_options (tree args, bool attr_p)
j++;
}
decoded_options_count = j;
- /* And apply them. */
+
+ /* Merge the decoded options with save_decoded_options. */
+ unsigned save_opt_count = save_opt_decoded_options.length ();
+ unsigned merged_decoded_options_count
+ = save_opt_count + decoded_options_count;
+ cl_decoded_option *merged_decoded_options
+ = XNEWVEC (cl_decoded_option, merged_decoded_options_count);
+
+ for (unsigned i = 0; i < save_opt_count; ++i)
+ merged_decoded_options[i] = save_opt_decoded_options[i];
+ for (unsigned i = 0; i < decoded_options_count; ++i)
+ merged_decoded_options[save_opt_count + i] = decoded_options[i];
+
+ /* And apply them. */
decode_options (&global_options, &global_options_set,
- decoded_options, decoded_options_count,
+ merged_decoded_options, merged_decoded_options_count,
input_location, global_dc, NULL);
free (decoded_options);
diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi
index 8fc66d626d8..3b501a8be3a 100644
--- a/gcc/doc/extend.texi
+++ b/gcc/doc/extend.texi
@@ -3593,7 +3593,10 @@ take function pointer arguments.
@cindex @code{optimize} function attribute
The @code{optimize} attribute is used to specify that a function is to
be compiled with different optimization options than specified on the
-command line. Valid arguments are constant non-negative integers and
+command line. The optimize attribute arguments of a function behave
+as if they were added to the command line options.
+
+Valid arguments are constant non-negative integers and
strings. Each numeric argument specifies an optimization @var{level}.
Each @var{string} argument consists of one or more comma-separated
substrings. Each substring that begins with the letter @code{O} refers
@@ -3797,7 +3800,8 @@ This attribute prevents stack protection code for the function.
Multiple target back ends implement the @code{target} attribute
to specify that a function is to
be compiled with different target options than specified on the
-command line. One or more strings can be provided as arguments.
+command line. The original target command line options are ignored.
+One or more strings can be provided as arguments.
Each string consists of one or more comma-separated suffixes to
the @code{-m} prefix jointly forming the name of a machine-dependent
option. @xref{Submodel Options,,Machine-Dependent Options}.
diff --git a/gcc/testsuite/gcc.target/i386/attr-optimize.c b/gcc/testsuite/gcc.target/i386/attr-optimize.c
new file mode 100644
index 00000000000..f5db028f1fd
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/attr-optimize.c
@@ -0,0 +1,24 @@
+/* { dg-do compile } */
+/* { dg-additional-options "-O1 -ftree-slp-vectorize -march=znver1 -fdump-tree-optimized" } */
+
+/* Use -O2, but -ftree-slp-vectorize option should be preserved and used. */
+#pragma GCC optimize "-O2"
+
+typedef struct {
+ long n[4];
+} secp256k1_fe;
+
+void *a;
+int c;
+static void
+fn1(secp256k1_fe *p1, int p2)
+{
+ p1->n[0] = p1->n[1] = p2;
+}
+void
+fn2()
+{
+ fn1(a, !c);
+}
+
+/* { dg-final { scan-tree-dump { MEM <vector\(2\) long int> \[[^]]*\] = } "optimized" } } */
diff --git a/gcc/testsuite/gcc.target/i386/avx512er-vrsqrt28ps-3.c b/gcc/testsuite/gcc.target/i386/avx512er-vrsqrt28ps-3.c
index 1ba8172d6e3..40aefb50844 100644
--- a/gcc/testsuite/gcc.target/i386/avx512er-vrsqrt28ps-3.c
+++ b/gcc/testsuite/gcc.target/i386/avx512er-vrsqrt28ps-3.c
@@ -8,7 +8,7 @@
#define MAX 1000
#define EPS 0.00001
-__attribute__ ((noinline, optimize (1)))
+__attribute__ ((noinline, optimize (1, "-fno-fast-math")))
void static
compute_rsqrt_ref (float *a, float *r)
{
diff --git a/gcc/testsuite/gcc.target/i386/avx512er-vrsqrt28ps-5.c b/gcc/testsuite/gcc.target/i386/avx512er-vrsqrt28ps-5.c
index e067a81e562..498f4d50aa5 100644
--- a/gcc/testsuite/gcc.target/i386/avx512er-vrsqrt28ps-5.c
+++ b/gcc/testsuite/gcc.target/i386/avx512er-vrsqrt28ps-5.c
@@ -8,7 +8,7 @@
#define MAX 1000
#define EPS 0.00001
-__attribute__ ((noinline, optimize (1)))
+__attribute__ ((noinline, optimize (1, "-fno-fast-math")))
void static
compute_sqrt_ref (float *a, float *r)
{
diff --git a/gcc/toplev.c b/gcc/toplev.c
index 43f1f7d345e..3e26ad97ff0 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -121,6 +121,9 @@ static bool no_backend;
struct cl_decoded_option *save_decoded_options;
unsigned int save_decoded_options_count;
+/* Vector of saved Optimization decoded command line options. */
+auto_vec<cl_decoded_option> save_opt_decoded_options;
+
/* Used to enable -fvar-tracking, -fweb and -frename-registers according
to optimize in process_options (). */
#define AUTODETECT_VALUE 2
@@ -2335,6 +2338,11 @@ toplev::main (int argc, char **argv)
&save_decoded_options,
&save_decoded_options_count);
+ /* Save Optimization decoded options. */
+ for (unsigned i = 0; i < save_decoded_options_count; ++i)
+ if (cl_options[save_decoded_options[i].opt_index].flags & CL_OPTIMIZATION)
+ save_opt_decoded_options.safe_push (save_decoded_options[i]);
+
/* Perform language-specific options initialization. */
lang_hooks.init_options (save_decoded_options_count, save_decoded_options);
diff --git a/gcc/toplev.h b/gcc/toplev.h
index 175944c85b7..9a1d2e6986f 100644
--- a/gcc/toplev.h
+++ b/gcc/toplev.h
@@ -23,6 +23,7 @@ along with GCC; see the file COPYING3. If not see
/* Decoded options, and number of such options. */
extern struct cl_decoded_option *save_decoded_options;
extern unsigned int save_decoded_options_count;
+extern auto_vec<cl_decoded_option> save_opt_decoded_options;
class timer;
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-08-24 14:39 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-28 14:53 [gcc(refs/users/marxin/heads/optimize-target-add-to-cmdline-v2)] Append target/optimize attr to the current cmdline Martin Liska
2021-07-01 12:58 Martin Liska
2021-08-24 14:39 Martin Liska
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).